summaryrefslogtreecommitdiff
path: root/library/src/math/mod.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-11-28 12:40:16 +0100
committerLaurenz <laurmaedje@gmail.com>2022-11-28 12:40:16 +0100
commit989d170dc7318ca3cbaa5b76760eb14f4e6a8605 (patch)
tree0a486ddb4d339b8a43313f7c6e18b9595b8fd955 /library/src/math/mod.rs
parent7caf98fe42797eab59a39ef71071030c9790245a (diff)
Fragments
Diffstat (limited to 'library/src/math/mod.rs')
-rw-r--r--library/src/math/mod.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/library/src/math/mod.rs b/library/src/math/mod.rs
index 3b1d66e9..7136c8b9 100644
--- a/library/src/math/mod.rs
+++ b/library/src/math/mod.rs
@@ -19,7 +19,7 @@ pub struct MathNode {
pub display: bool,
}
-#[node(Show, LayoutInline, Texify)]
+#[node(Show, Layout, Inline, Texify)]
impl MathNode {
fn field(&self, name: &str) -> Option<Value> {
match name {
@@ -48,17 +48,19 @@ impl Show for MathNode {
}
}
-impl LayoutInline for MathNode {
- fn layout_inline(
+impl Layout for MathNode {
+ fn layout(
&self,
world: Tracked<dyn World>,
styles: StyleChain,
_: &Regions,
- ) -> SourceResult<Frame> {
+ ) -> SourceResult<Fragment> {
layout_tex(world, &self.texify(), self.display, styles)
}
}
+impl Inline for MathNode {}
+
impl Texify for MathNode {
fn texify(&self) -> EcoString {
self.children.iter().map(Texify::texify).collect()