mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-28 21:04:47 +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
|
@ -347,6 +347,8 @@ impl RenderingPrimitivesBuilder for GLRenderingPrimitivesBuilder {
|
|||
RenderingPrimitive::Path {
|
||||
x: _,
|
||||
y: _,
|
||||
width,
|
||||
height,
|
||||
elements,
|
||||
fill_color,
|
||||
stroke_color,
|
||||
|
@ -354,7 +356,7 @@ impl RenderingPrimitivesBuilder for GLRenderingPrimitivesBuilder {
|
|||
} => {
|
||||
let mut primitives = SmallVec::new();
|
||||
|
||||
let path_iter = elements.iter();
|
||||
let path_iter = elements.iter().fitted(*width, *height);
|
||||
|
||||
if *fill_color != Color::TRANSPARENT {
|
||||
primitives.extend(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue