From e5eab73374880077971f3f22acbdd3d302877128 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Wed, 8 Mar 2023 10:54:04 +0100 Subject: Streamline field names --- library/src/math/attach.rs | 8 ++++---- library/src/math/matrix.rs | 8 ++++---- library/src/math/mod.rs | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'library/src/math') diff --git a/library/src/math/attach.rs b/library/src/math/attach.rs index 9181ab7c..7ba1484a 100644 --- a/library/src/math/attach.rs +++ b/library/src/math/attach.rs @@ -79,12 +79,12 @@ pub struct ScriptsNode { /// The base to attach the scripts to. #[positional] #[required] - pub base: Content, + pub body: Content, } impl LayoutMath for ScriptsNode { fn layout_math(&self, ctx: &mut MathContext) -> SourceResult<()> { - self.base().layout_math(ctx) + self.body().layout_math(ctx) } } @@ -102,12 +102,12 @@ pub struct LimitsNode { /// The base to attach the limits to. #[positional] #[required] - pub base: Content, + pub body: Content, } impl LayoutMath for LimitsNode { fn layout_math(&self, ctx: &mut MathContext) -> SourceResult<()> { - self.base().layout_math(ctx) + self.body().layout_math(ctx) } } diff --git a/library/src/math/matrix.rs b/library/src/math/matrix.rs index 3e257385..c7303735 100644 --- a/library/src/math/matrix.rs +++ b/library/src/math/matrix.rs @@ -20,7 +20,7 @@ const VERTICAL_PADDING: Ratio = Ratio::new(0.1); pub struct VecNode { /// The elements of the vector. #[variadic] - pub elements: Vec, + pub children: Vec, /// The delimiter to use. /// @@ -36,7 +36,7 @@ pub struct VecNode { impl LayoutMath for VecNode { fn layout_math(&self, ctx: &mut MathContext) -> SourceResult<()> { let delim = ctx.styles().get(Self::DELIM); - let frame = layout_vec_body(ctx, &self.elements(), Align::Center)?; + let frame = layout_vec_body(ctx, &self.children(), Align::Center)?; layout_delimiters(ctx, frame, Some(delim.open()), Some(delim.close())) } } @@ -141,7 +141,7 @@ impl LayoutMath for MatNode { pub struct CasesNode { /// The branches of the case distinction. #[variadic] - pub branches: Vec, + pub children: Vec, /// The delimiter to use. /// @@ -157,7 +157,7 @@ pub struct CasesNode { impl LayoutMath for CasesNode { fn layout_math(&self, ctx: &mut MathContext) -> SourceResult<()> { let delim = ctx.styles().get(Self::DELIM); - let frame = layout_vec_body(ctx, &self.branches(), Align::Left)?; + let frame = layout_vec_body(ctx, &self.children(), Align::Left)?; layout_delimiters(ctx, frame, Some(delim.open()), None) } } diff --git a/library/src/math/mod.rs b/library/src/math/mod.rs index d719cb1a..6f5e5907 100644 --- a/library/src/math/mod.rs +++ b/library/src/math/mod.rs @@ -242,7 +242,7 @@ impl LayoutMath for Content { let prev_size = ctx.size; ctx.map.apply(prev_map.clone()); ctx.size = ctx.styles().get(TextNode::SIZE); - styled.sub().layout_math(ctx)?; + styled.body().layout_math(ctx)?; ctx.size = prev_size; ctx.map = prev_map; return Ok(()); -- cgit v1.2.3