summaryrefslogtreecommitdiff
path: root/crates/typst-library/src/visualize/path.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/visualize/path.rs
parent0a3c6939dd274f40672484695d909c2cc0d0d755 (diff)
Target-specific native show rules (#6569)
Diffstat (limited to 'crates/typst-library/src/visualize/path.rs')
-rw-r--r--crates/typst-library/src/visualize/path.rs20
1 files changed, 4 insertions, 16 deletions
diff --git a/crates/typst-library/src/visualize/path.rs b/crates/typst-library/src/visualize/path.rs
index e19e091d..bd8aea02 100644
--- a/crates/typst-library/src/visualize/path.rs
+++ b/crates/typst-library/src/visualize/path.rs
@@ -1,11 +1,7 @@
use self::PathVertex::{AllControlPoints, MirroredControlPoint, Vertex};
-use crate::diag::{bail, SourceResult};
-use crate::engine::Engine;
-use crate::foundations::{
- array, cast, elem, Array, Content, NativeElement, Packed, Reflect, Show, Smart,
- StyleChain,
-};
-use crate::layout::{Axes, BlockElem, Length, Rel};
+use crate::diag::bail;
+use crate::foundations::{array, cast, elem, Array, Reflect, Smart};
+use crate::layout::{Axes, Length, Rel};
use crate::visualize::{FillRule, Paint, Stroke};
/// A path through a list of points, connected by Bézier curves.
@@ -21,7 +17,7 @@ use crate::visualize::{FillRule, Paint, Stroke};
/// ((50%, 0pt), (40pt, 0pt)),
/// )
/// ```
-#[elem(Show)]
+#[elem]
pub struct PathElem {
/// How to fill the path.
///
@@ -83,14 +79,6 @@ pub struct PathElem {
pub vertices: Vec<PathVertex>,
}
-impl Show for Packed<PathElem> {
- fn show(&self, engine: &mut Engine, _: StyleChain) -> SourceResult<Content> {
- Ok(BlockElem::single_layouter(self.clone(), engine.routines.layout_path)
- .pack()
- .spanned(self.span()))
- }
-}
-
/// A component used for path creation.
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum PathVertex {