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:
Simon Hausmann 2020-07-13 15:38:56 +02:00
parent 79ba943882
commit 992f990fa8
12 changed files with 162 additions and 36 deletions

View file

@ -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(