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

@ -53,11 +53,15 @@ pub struct PathLayout {
pub elements: Vec<ElementRc>,
pub x_reference: Box<Expression>,
pub y_reference: Box<Expression>,
pub width_reference: Box<Expression>,
pub height_reference: Box<Expression>,
}
impl ExpressionFieldsVisitor for PathLayout {
fn visit_expressions(&mut self, mut visitor: impl FnMut(&mut Expression)) {
visitor(&mut self.x_reference);
visitor(&mut self.y_reference);
visitor(&mut self.width_reference);
visitor(&mut self.height_reference);
}
}