mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-28 12:54:45 +00:00
Allow for fitting paths into a given bounding rectangle
... by applying a transformation. This allows designing a path in some other path design tool and then make it fit using bindings.
This commit is contained in:
parent
79ba943882
commit
992f990fa8
12 changed files with 162 additions and 36 deletions
|
@ -163,6 +163,8 @@ pub struct PathLayoutData<'a> {
|
|||
pub items: Slice<'a, PathLayoutItemData<'a>>,
|
||||
pub x: Coord,
|
||||
pub y: Coord,
|
||||
pub width: Coord,
|
||||
pub height: Coord,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
|
@ -178,7 +180,7 @@ pub extern "C" fn solve_path_layout(data: &PathLayoutData) {
|
|||
use lyon::geom::*;
|
||||
use lyon::path::iterator::PathIterator;
|
||||
|
||||
let path_iter = data.elements.iter();
|
||||
let path_iter = data.elements.iter().fitted(data.width, data.height);
|
||||
|
||||
let tolerance = 0.01;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue