mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 06:11:16 +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
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue