diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-03-12 14:12:30 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-03-12 14:12:30 +0100 |
| commit | 584a43277dbfbdba834a2681afe63d10598db3f9 (patch) | |
| tree | 2a7b8d1f6b41fa39996c907d8d582b4c52448fcd /src/library/image.rs | |
| parent | ffcb8cd97a7107bfd66805b1073c5ef3e0dd59a7 (diff) | |
Rename ChildAlign to LayoutAligns ✏
Diffstat (limited to 'src/library/image.rs')
| -rw-r--r-- | src/library/image.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/library/image.rs b/src/library/image.rs index 06908ce8..d9c0a0a7 100644 --- a/src/library/image.rs +++ b/src/library/image.rs @@ -25,7 +25,7 @@ pub fn image(ctx: &mut EvalContext, args: &mut ValueArgs) -> Value { dimensions, width, height, - align: ctx.state.align, + aligns: ctx.state.aligns, }); } else { ctx.diag(error!(path.span, "failed to load image")); @@ -37,6 +37,8 @@ pub fn image(ctx: &mut EvalContext, args: &mut ValueArgs) -> Value { /// An image node. #[derive(Debug, Clone, PartialEq)] struct NodeImage { + /// How to align this image node in its parent. + aligns: LayoutAligns, /// The resource id of the image file. res: ResourceId, /// The pixel dimensions of the image. @@ -45,8 +47,6 @@ struct NodeImage { width: Option<Linear>, /// The fixed height, if any. height: Option<Linear>, - /// How to align this image node in its parent. - align: ChildAlign, } impl Layout for NodeImage { @@ -81,7 +81,7 @@ impl Layout for NodeImage { let mut frame = Frame::new(size); frame.push(Point::ZERO, Element::Image(Image { res: self.res, size })); - Layouted::Frame(frame, self.align) + Layouted::Frame(frame, self.aligns) } } |
