summaryrefslogtreecommitdiff
path: root/library/src/text/shift.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-11-07 12:21:12 +0100
committerLaurenz <laurmaedje@gmail.com>2022-11-07 12:46:05 +0100
commitefd1853d069fbd1476e82d015da4d0d04cfaccc0 (patch)
tree842b745c134306539d10c61be9485794fe8dc7dc /library/src/text/shift.rs
parenteb951c008beea502042db4a3a0e8d1f8b51f6f52 (diff)
Show it!
- New show rule syntax - Set if syntax - Removed wrap syntax
Diffstat (limited to 'library/src/text/shift.rs')
-rw-r--r--library/src/text/shift.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/library/src/text/shift.rs b/library/src/text/shift.rs
index 1117cc00..0f654b5a 100644
--- a/library/src/text/shift.rs
+++ b/library/src/text/shift.rs
@@ -33,12 +33,6 @@ impl<const S: ShiftKind> ShiftNode<S> {
fn construct(_: &mut Vm, args: &mut Args) -> SourceResult<Content> {
Ok(Self(args.expect("body")?).pack())
}
-}
-
-impl<const S: ShiftKind> Show for ShiftNode<S> {
- fn unguard_parts(&self, _: Selector) -> Content {
- Self(self.0.clone()).pack()
- }
fn field(&self, name: &str) -> Option<Value> {
match name {
@@ -46,8 +40,14 @@ impl<const S: ShiftKind> Show for ShiftNode<S> {
_ => None,
}
}
+}
+
+impl<const S: ShiftKind> Show for ShiftNode<S> {
+ fn unguard_parts(&self, _: Selector) -> Content {
+ Self(self.0.clone()).pack()
+ }
- fn realize(
+ fn show(
&self,
world: Tracked<dyn World>,
styles: StyleChain,
@@ -56,7 +56,7 @@ impl<const S: ShiftKind> Show for ShiftNode<S> {
if styles.get(Self::TYPOGRAPHIC) {
if let Some(text) = search_text(&self.0, S) {
if is_shapable(world, &text, styles) {
- transformed = Some(TextNode(text).pack());
+ transformed = Some(TextNode::packed(text));
}
}
};