summaryrefslogtreecommitdiff
path: root/src/doc.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-02-12 18:58:39 +0100
committerLaurenz <laurmaedje@gmail.com>2023-02-12 19:57:28 +0100
commit3ffa7393f0632d9ee5dd9c821685a1a033d5c0ab (patch)
treeaf09b0683352c4028436a2e5251dce54cf41d4aa /src/doc.rs
parentf4856c18b9cf3f6952276cc61b557aebeb2fa651 (diff)
Make all nodes block-level
Diffstat (limited to 'src/doc.rs')
-rw-r--r--src/doc.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/doc.rs b/src/doc.rs
index 988520c5..47bdb23d 100644
--- a/src/doc.rs
+++ b/src/doc.rs
@@ -267,6 +267,10 @@ impl Frame {
/// Attach the metadata from this style chain to the frame.
pub fn meta(&mut self, styles: StyleChain) {
for meta in styles.get(Meta::DATA) {
+ if matches!(meta, Meta::Hidden) {
+ self.clear();
+ break;
+ }
self.push(Point::zero(), Element::Meta(meta, self.size));
}
}
@@ -533,6 +537,8 @@ pub enum Meta {
/// An identifiable piece of content that produces something within the
/// area this metadata is attached to.
Node(StableId, Content),
+ /// Indicates that the content is hidden.
+ Hidden,
}
#[node]