summaryrefslogtreecommitdiff
path: root/src/library/structure
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-04-07 14:32:35 +0200
committerLaurenz <laurmaedje@gmail.com>2022-04-07 16:19:51 +0200
commit1192132dc0a9e991953fd29e93f87c8437a53ea0 (patch)
tree67061e75a5a15c7997a3ac2de349b5e9ce234434 /src/library/structure
parenteb22eed31b08874fbbbee68d2ae59f0d02f9e95d (diff)
Rename length-related types
`Fractional` => `Fraction` `Relative` => `Ratio` `Linear` => `Relative`
Diffstat (limited to 'src/library/structure')
-rw-r--r--src/library/structure/heading.rs2
-rw-r--r--src/library/structure/list.rs12
-rw-r--r--src/library/structure/table.rs4
3 files changed, 9 insertions, 9 deletions
diff --git a/src/library/structure/heading.rs b/src/library/structure/heading.rs
index 7b00c643..8b143865 100644
--- a/src/library/structure/heading.rs
+++ b/src/library/structure/heading.rs
@@ -23,7 +23,7 @@ impl HeadingNode {
#[property(referenced)]
pub const SIZE: Leveled<FontSize> = Leveled::Mapping(|level| {
let upscale = (1.6 - 0.1 * level as f64).max(0.75);
- FontSize(Relative::new(upscale).into())
+ FontSize(Ratio::new(upscale).into())
});
/// Whether text in the heading is strengthend.
#[property(referenced)]
diff --git a/src/library/structure/list.rs b/src/library/structure/list.rs
index 1b22e166..532ec625 100644
--- a/src/library/structure/list.rs
+++ b/src/library/structure/list.rs
@@ -34,11 +34,11 @@ impl<const L: ListKind> ListNode<L> {
#[property(referenced)]
pub const LABEL: Label = Label::Default;
/// The spacing between the list items of a non-wide list.
- pub const SPACING: Linear = Linear::zero();
+ pub const SPACING: Relative = Relative::zero();
/// The indentation of each item's label.
- pub const INDENT: Linear = Relative::new(0.0).into();
+ pub const INDENT: Relative = Ratio::new(0.0).into();
/// The space between the label and the body of each item.
- pub const BODY_INDENT: Linear = Relative::new(0.5).into();
+ pub const BODY_INDENT: Relative = Ratio::new(0.5).into();
/// The extra padding above the list.
pub const ABOVE: Length = Length::zero();
/// The extra padding below the list.
@@ -91,12 +91,12 @@ impl<const L: ListKind> Show for ListNode<L> {
Content::block(GridNode {
tracks: Spec::with_x(vec![
- TrackSizing::Linear(indent.into()),
+ TrackSizing::Relative(indent.into()),
TrackSizing::Auto,
- TrackSizing::Linear(body_indent.into()),
+ TrackSizing::Relative(body_indent.into()),
TrackSizing::Auto,
]),
- gutter: Spec::with_y(vec![TrackSizing::Linear(gutter.into())]),
+ gutter: Spec::with_y(vec![TrackSizing::Relative(gutter.into())]),
children,
})
};
diff --git a/src/library/structure/table.rs b/src/library/structure/table.rs
index 64785006..9317e43f 100644
--- a/src/library/structure/table.rs
+++ b/src/library/structure/table.rs
@@ -18,12 +18,12 @@ impl TableNode {
pub const PRIMARY: Option<Paint> = None;
/// The secondary cell fill color.
pub const SECONDARY: Option<Paint> = None;
- /// How the stroke the cells.
+ /// How to stroke the cells.
pub const STROKE: Option<Paint> = Some(Color::BLACK.into());
/// The stroke's thickness.
pub const THICKNESS: Length = Length::pt(1.0);
/// How much to pad the cells's content.
- pub const PADDING: Linear = Length::pt(5.0).into();
+ pub const PADDING: Relative = Length::pt(5.0).into();
fn construct(_: &mut Context, args: &mut Args) -> TypResult<Content> {
let columns = args.named("columns")?.unwrap_or_default();