summaryrefslogtreecommitdiff
path: root/crates/typst-library/src/layout/align.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2025-07-09 10:16:36 +0200
committerGitHub <noreply@github.com>2025-07-09 08:16:36 +0000
commite5e1dcd9c01341d2cd3473ac94a70223d5966086 (patch)
treed648efad9463cb10270d55ba35210eeb1e91ee22 /crates/typst-library/src/layout/align.rs
parent0a3c6939dd274f40672484695d909c2cc0d0d755 (diff)
Target-specific native show rules (#6569)
Diffstat (limited to 'crates/typst-library/src/layout/align.rs')
-rw-r--r--crates/typst-library/src/layout/align.rs16
1 files changed, 4 insertions, 12 deletions
diff --git a/crates/typst-library/src/layout/align.rs b/crates/typst-library/src/layout/align.rs
index e5ceddf6..447648f0 100644
--- a/crates/typst-library/src/layout/align.rs
+++ b/crates/typst-library/src/layout/align.rs
@@ -2,11 +2,10 @@ use std::ops::Add;
use ecow::{eco_format, EcoString};
-use crate::diag::{bail, HintedStrResult, SourceResult, StrResult};
-use crate::engine::Engine;
+use crate::diag::{bail, HintedStrResult, StrResult};
use crate::foundations::{
- cast, elem, func, scope, ty, CastInfo, Content, Fold, FromValue, IntoValue, Packed,
- Reflect, Repr, Resolve, Show, StyleChain, Value,
+ cast, elem, func, scope, ty, CastInfo, Content, Fold, FromValue, IntoValue, Reflect,
+ Repr, Resolve, StyleChain, Value,
};
use crate::layout::{Abs, Axes, Axis, Dir, Side};
use crate::text::TextElem;
@@ -73,7 +72,7 @@ use crate::text::TextElem;
/// ```example
/// Start #h(1fr) End
/// ```
-#[elem(Show)]
+#[elem]
pub struct AlignElem {
/// The [alignment] along both axes.
///
@@ -97,13 +96,6 @@ pub struct AlignElem {
pub body: Content,
}
-impl Show for Packed<AlignElem> {
- #[typst_macros::time(name = "align", span = self.span())]
- fn show(&self, _: &mut Engine, styles: StyleChain) -> SourceResult<Content> {
- Ok(self.body.clone().aligned(self.alignment.get(styles)))
- }
-}
-
/// Where to align something along an axis.
///
/// Possible values are: