summaryrefslogtreecommitdiff
path: root/src/library/shape.rs
diff options
context:
space:
mode:
authorMartin <mhaug@live.de>2022-01-01 12:56:03 +0100
committerGitHub <noreply@github.com>2022-01-01 12:56:03 +0100
commit28fc2893e873d44aa31a64a87cb3e2e975977a70 (patch)
treebad022650bb488492386e4fc079dde3807b89304 /src/library/shape.rs
parent5d5d8a21cfc041ab08d30229f4ecb4cbb415cbc5 (diff)
parent179a9f479831c4941253c0517fccdec3acd8f2ff (diff)
Merge pull request #53 from typst/style-chains
Diffstat (limited to 'src/library/shape.rs')
-rw-r--r--src/library/shape.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/library/shape.rs b/src/library/shape.rs
index 15a857ef..76c03edb 100644
--- a/src/library/shape.rs
+++ b/src/library/shape.rs
@@ -106,11 +106,12 @@ impl Layout for ShapeNode {
&self,
ctx: &mut LayoutContext,
regions: &Regions,
+ styles: StyleChain,
) -> Vec<Constrained<Rc<Frame>>> {
let mut frames;
if let Some(child) = &self.child {
let mut pod = Regions::one(regions.current, regions.base, regions.expand);
- frames = child.layout(ctx, &pod);
+ frames = child.layout(ctx, &pod, styles);
// Relayout with full expansion into square region to make sure
// the result is really a square or circle.
@@ -126,7 +127,7 @@ impl Layout for ShapeNode {
pod.current = Size::splat(length);
pod.expand = Spec::splat(true);
- frames = child.layout(ctx, &pod);
+ frames = child.layout(ctx, &pod, styles);
frames[0].cts = Constraints::tight(regions);
}
} else {
@@ -169,7 +170,7 @@ impl Layout for ShapeNode {
}
// Apply link if it exists.
- if let Some(url) = ctx.styles.get_ref(LinkNode::URL) {
+ if let Some(url) = styles.get_ref(LinkNode::URL) {
frame.link(url);
}