From b1b4e52af9e2da8f8ae1fc17a81ed6cbcbb8f525 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 13 Feb 2023 15:14:25 +0100 Subject: Block sizing --- library/src/visualize/shape.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'library/src/visualize') diff --git a/library/src/visualize/shape.rs b/library/src/visualize/shape.rs index 7eddc6a6..e5259d91 100644 --- a/library/src/visualize/shape.rs +++ b/library/src/visualize/shape.rs @@ -160,6 +160,8 @@ impl Layout for RectNode { ) -> SourceResult { layout( vt, + styles, + regions, ShapeKind::Rect, &self.body, Axes::new(self.width, self.height), @@ -168,8 +170,6 @@ impl Layout for RectNode { styles.get(Self::INSET), styles.get(Self::OUTSET), styles.get(Self::RADIUS), - styles, - regions, ) } } @@ -278,6 +278,8 @@ impl Layout for SquareNode { ) -> SourceResult { layout( vt, + styles, + regions, ShapeKind::Square, &self.body, Axes::new(self.width, self.height), @@ -286,8 +288,6 @@ impl Layout for SquareNode { styles.get(Self::INSET), styles.get(Self::OUTSET), styles.get(Self::RADIUS), - styles, - regions, ) } } @@ -372,6 +372,8 @@ impl Layout for EllipseNode { ) -> SourceResult { layout( vt, + styles, + regions, ShapeKind::Ellipse, &self.body, Axes::new(self.width, self.height), @@ -380,8 +382,6 @@ impl Layout for EllipseNode { styles.get(Self::INSET), styles.get(Self::OUTSET), Corners::splat(Rel::zero()), - styles, - regions, ) } } @@ -485,6 +485,8 @@ impl Layout for CircleNode { ) -> SourceResult { layout( vt, + styles, + regions, ShapeKind::Circle, &self.body, Axes::new(self.width, self.height), @@ -493,8 +495,6 @@ impl Layout for CircleNode { styles.get(Self::INSET), styles.get(Self::OUTSET), Corners::splat(Rel::zero()), - styles, - regions, ) } } @@ -502,6 +502,8 @@ impl Layout for CircleNode { /// Layout a shape. fn layout( vt: &mut Vt, + styles: StyleChain, + regions: Regions, kind: ShapeKind, body: &Option, sizing: Axes>>, @@ -510,8 +512,6 @@ fn layout( mut inset: Sides>, outset: Sides>, radius: Corners>, - styles: StyleChain, - regions: Regions, ) -> SourceResult { let resolved = sizing .zip(regions.base()) -- cgit v1.2.3