diff options
| author | Laurenz <laurmaedje@gmail.com> | 2025-07-09 10:16:36 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-09 08:16:36 +0000 |
| commit | e5e1dcd9c01341d2cd3473ac94a70223d5966086 (patch) | |
| tree | d648efad9463cb10270d55ba35210eeb1e91ee22 /crates/typst-library/src/visualize/image/mod.rs | |
| parent | 0a3c6939dd274f40672484695d909c2cc0d0d755 (diff) | |
Target-specific native show rules (#6569)
Diffstat (limited to 'crates/typst-library/src/visualize/image/mod.rs')
| -rw-r--r-- | crates/typst-library/src/visualize/image/mod.rs | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/crates/typst-library/src/visualize/image/mod.rs b/crates/typst-library/src/visualize/image/mod.rs index 48a14f0e..95021b81 100644 --- a/crates/typst-library/src/visualize/image/mod.rs +++ b/crates/typst-library/src/visualize/image/mod.rs @@ -15,13 +15,11 @@ use ecow::EcoString; use typst_syntax::{Span, Spanned}; use typst_utils::LazyHash; -use crate::diag::{SourceResult, StrResult}; -use crate::engine::Engine; +use crate::diag::StrResult; use crate::foundations::{ - cast, elem, func, scope, Bytes, Cast, Content, Derived, NativeElement, Packed, Show, - Smart, StyleChain, + cast, elem, func, scope, Bytes, Cast, Content, Derived, NativeElement, Packed, Smart, }; -use crate::layout::{BlockElem, Length, Rel, Sizing}; +use crate::layout::{Length, Rel, Sizing}; use crate::loading::{DataSource, Load, LoadSource, Loaded, Readable}; use crate::model::Figurable; use crate::text::LocalName; @@ -44,7 +42,7 @@ use crate::text::LocalName; /// ], /// ) /// ``` -#[elem(scope, Show, LocalName, Figurable)] +#[elem(scope, LocalName, Figurable)] pub struct ImageElem { /// A [path]($syntax/#paths) to an image file or raw bytes making up an /// image in one of the supported [formats]($image.format). @@ -219,16 +217,6 @@ impl ImageElem { } } -impl Show for Packed<ImageElem> { - fn show(&self, engine: &mut Engine, styles: StyleChain) -> SourceResult<Content> { - Ok(BlockElem::single_layouter(self.clone(), engine.routines.layout_image) - .with_width(self.width.get(styles)) - .with_height(self.height.get(styles)) - .pack() - .spanned(self.span())) - } -} - impl LocalName for Packed<ImageElem> { const KEY: &'static str = "figure"; } |
