summaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorWenzhuo Liu <mgt@oi-wiki.org>2024-01-09 16:12:08 +0800
committerGitHub <noreply@github.com>2024-01-09 08:12:08 +0000
commitcc1f974164ab5d42c3eb1b8fcd7a9227fbfd1d0e (patch)
tree88a558e197eeb47bf1d51eb24987396843e15a60 /crates
parent23875a04832a79b6c4fa47d243d9af9650839ff6 (diff)
Partially fix hide for line, polygon, table, grid (#3139)
Diffstat (limited to 'crates')
-rw-r--r--crates/typst/src/layout/grid/layout.rs4
-rw-r--r--crates/typst/src/visualize/image/mod.rs1
-rw-r--r--crates/typst/src/visualize/line.rs1
-rw-r--r--crates/typst/src/visualize/polygon.rs1
4 files changed, 7 insertions, 0 deletions
diff --git a/crates/typst/src/layout/grid/layout.rs b/crates/typst/src/layout/grid/layout.rs
index 24d641a6..b58e73c8 100644
--- a/crates/typst/src/layout/grid/layout.rs
+++ b/crates/typst/src/layout/grid/layout.rs
@@ -376,6 +376,10 @@ impl<'a> GridLayouter<'a> {
self.render_fills_strokes()?;
+ for frame in &mut self.finished {
+ frame.meta(self.styles, false);
+ }
+
Ok(Fragment::frames(self.finished))
}
diff --git a/crates/typst/src/visualize/image/mod.rs b/crates/typst/src/visualize/image/mod.rs
index 5bfda381..7aa8361b 100644
--- a/crates/typst/src/visualize/image/mod.rs
+++ b/crates/typst/src/visualize/image/mod.rs
@@ -236,6 +236,7 @@ impl Layout for ImageElem {
// Create a clipping group if only part of the image should be visible.
if fit == ImageFit::Cover && !target.fits(fitted) {
+ frame.meta(styles, false);
frame.clip(Path::rect(frame.size()));
}
diff --git a/crates/typst/src/visualize/line.rs b/crates/typst/src/visualize/line.rs
index 12ec4473..94841d39 100644
--- a/crates/typst/src/visualize/line.rs
+++ b/crates/typst/src/visualize/line.rs
@@ -89,6 +89,7 @@ impl Layout for LineElem {
let mut frame = Frame::soft(target);
let shape = Geometry::Line(delta.to_point()).stroked(stroke);
frame.push(start.to_point(), FrameItem::Shape(shape, self.span()));
+ frame.meta(styles, false);
Ok(Fragment::frame(frame))
}
}
diff --git a/crates/typst/src/visualize/polygon.rs b/crates/typst/src/visualize/polygon.rs
index 14156ce1..3b686f79 100644
--- a/crates/typst/src/visualize/polygon.rs
+++ b/crates/typst/src/visualize/polygon.rs
@@ -171,6 +171,7 @@ impl Layout for PolygonElem {
let shape = Shape { geometry: Geometry::Path(path), stroke, fill };
frame.push(Point::zero(), FrameItem::Shape(shape, self.span()));
+ frame.meta(styles, false);
Ok(Fragment::frame(frame))
}