diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-07-08 22:33:44 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-07-08 22:33:44 +0200 |
| commit | fd0b89a1d8e4f811fcf3517d321a327a0cf72edf (patch) | |
| tree | 75d247866f5db1a0ad32909da6e0fdaafa479592 /src/layout/background.rs | |
| parent | 7e2c217cbc3805c4cae613baf4149cc82e10d503 (diff) | |
Rename Fill to Paint
Diffstat (limited to 'src/layout/background.rs')
| -rw-r--r-- | src/layout/background.rs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/layout/background.rs b/src/layout/background.rs index 013a887a..0e93c06f 100644 --- a/src/layout/background.rs +++ b/src/layout/background.rs @@ -6,8 +6,8 @@ use super::*; pub struct BackgroundNode { /// The kind of shape to use as a background. pub shape: BackgroundShape, - /// The background fill. - pub fill: Fill, + /// Background color / texture. + pub fill: Paint, /// The child node to be filled. pub child: AnyNode, } @@ -29,19 +29,16 @@ impl Layout for BackgroundNode { for frame in &mut frames { let mut new = Frame::new(frame.size, frame.baseline); - let (point, shape) = match self.shape { - BackgroundShape::Rect => (Point::zero(), Shape::Rect(frame.size)), + let (point, geometry) = match self.shape { + BackgroundShape::Rect => (Point::zero(), Geometry::Rect(frame.size)), BackgroundShape::Ellipse => { - (frame.size.to_point() / 2.0, Shape::Ellipse(frame.size)) + (frame.size.to_point() / 2.0, Geometry::Ellipse(frame.size)) } }; - let element = Element::Geometry(shape, self.fill); - new.push(point, element); - let prev = std::mem::take(&mut frame.item); + new.push(point, Element::Geometry(geometry, self.fill)); new.push_frame(Point::zero(), prev); - *Rc::make_mut(&mut frame.item) = new; } frames |
