diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-05-21 12:55:36 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-05-21 12:55:36 +0200 |
| commit | 6472c1e425013021acb19f77c29f1896e202482e (patch) | |
| tree | 258a3e5898d59e86c64e0b3fb5926e601fac2953 /src/library | |
| parent | 1cb6328d20a3edb09654ec579f514d42be9fe2fc (diff) | |
Rename areas to regions
Diffstat (limited to 'src/library')
| -rw-r--r-- | src/library/image.rs | 8 | ||||
| -rw-r--r-- | src/library/pad.rs | 2 | ||||
| -rw-r--r-- | src/library/shapes.rs | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/library/image.rs b/src/library/image.rs index 9e730a0e..9b880d04 100644 --- a/src/library/image.rs +++ b/src/library/image.rs @@ -2,7 +2,7 @@ use ::image::GenericImageView; use super::*; use crate::env::ImageId; -use crate::layout::{AnyNode, Areas, Element, Frame, Layout, LayoutContext}; +use crate::layout::{AnyNode, Element, Frame, Layout, LayoutContext, Regions}; /// `image`: An image. /// @@ -45,8 +45,8 @@ struct ImageNode { } impl Layout for ImageNode { - fn layout(&self, _: &mut LayoutContext, areas: &Areas) -> Vec<Frame> { - let Areas { current, base, .. } = areas; + fn layout(&self, _: &mut LayoutContext, regions: &Regions) -> Vec<Frame> { + let Regions { current, base, .. } = regions; let width = self.width.map(|w| w.resolve(base.width)); let height = self.height.map(|w| w.resolve(base.height)); @@ -66,7 +66,7 @@ impl Layout for ImageNode { // TODO: Fix issue with line spacing. Size::new(current.height * pixel_ratio, current.height) } else { - // Totally unbounded area, we have to make up something. + // Totally unbounded region, we have to make up something. Size::new(Length::pt(pixel_width), Length::pt(pixel_height)) } } diff --git a/src/library/pad.rs b/src/library/pad.rs index 24643948..bdc188a7 100644 --- a/src/library/pad.rs +++ b/src/library/pad.rs @@ -14,7 +14,7 @@ use crate::layout::PadNode; /// - Bottom padding: `bottom`, of type `linear` relative to parent height. /// /// # Return value -/// A template that sets the body into a padded area. +/// A template that pads its region and sets the body into it. pub fn pad(ctx: &mut EvalContext, args: &mut FuncArgs) -> Value { let all = args.eat(ctx); let left = args.eat_named(ctx, "left"); diff --git a/src/library/shapes.rs b/src/library/shapes.rs index 4d588140..cbd9a211 100644 --- a/src/library/shapes.rs +++ b/src/library/shapes.rs @@ -131,7 +131,7 @@ fn ellipse_impl( body: TemplateValue, ) -> Value { Value::template(name, move |ctx| { - // This padding ratio ensures that the rectangular padded area fits + // This padding ratio ensures that the rectangular padded region fits // perfectly into the ellipse. const PAD: f64 = 0.5 - SQRT_2 / 4.0; |
