summaryrefslogtreecommitdiff
path: root/crates/typst-library/src/visualize/polygon.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/polygon.rs
parent0a3c6939dd274f40672484695d909c2cc0d0d755 (diff)
Target-specific native show rules (#6569)
Diffstat (limited to 'crates/typst-library/src/visualize/polygon.rs')
-rw-r--r--crates/typst-library/src/visualize/polygon.rs18
1 files changed, 3 insertions, 15 deletions
diff --git a/crates/typst-library/src/visualize/polygon.rs b/crates/typst-library/src/visualize/polygon.rs
index d75e1a65..db75a267 100644
--- a/crates/typst-library/src/visualize/polygon.rs
+++ b/crates/typst-library/src/visualize/polygon.rs
@@ -2,12 +2,8 @@ use std::f64::consts::PI;
use typst_syntax::Span;
-use crate::diag::SourceResult;
-use crate::engine::Engine;
-use crate::foundations::{
- elem, func, scope, Content, NativeElement, Packed, Show, Smart, StyleChain,
-};
-use crate::layout::{Axes, BlockElem, Em, Length, Rel};
+use crate::foundations::{elem, func, scope, Content, NativeElement, Smart};
+use crate::layout::{Axes, Em, Length, Rel};
use crate::visualize::{FillRule, Paint, Stroke};
/// A closed polygon.
@@ -25,7 +21,7 @@ use crate::visualize::{FillRule, Paint, Stroke};
/// (0%, 2cm),
/// )
/// ```
-#[elem(scope, Show)]
+#[elem(scope)]
pub struct PolygonElem {
/// How to fill the polygon.
///
@@ -124,11 +120,3 @@ impl PolygonElem {
elem.pack().spanned(span)
}
}
-
-impl Show for Packed<PolygonElem> {
- fn show(&self, engine: &mut Engine, _: StyleChain) -> SourceResult<Content> {
- Ok(BlockElem::single_layouter(self.clone(), engine.routines.layout_polygon)
- .pack()
- .spanned(self.span()))
- }
-}