Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/draw/grouping.typ
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#import "/src/styles.typ"
#import "/src/drawable.typ"
#import "/src/vector.typ"
#import "/src/matrix.typ"
#import "/src/util.typ"
#import "/src/coordinate.typ"
#import "/src/aabb.typ"
Expand Down Expand Up @@ -206,6 +207,7 @@
let drawables = ()
let group-ctx = ctx
group-ctx.groups.push((anchors: (:)))
group-ctx.transform = matrix.ident()
(ctx: group-ctx, drawables, bounds) = process.many(group-ctx, if type(body) == function {body(ctx)} else {body})

// Apply bounds padding
Expand All @@ -221,7 +223,6 @@
// Calculate a bounding box path used for border
// anchor calculation.
let (center, width, height, path) = if bounds != none {
(bounds.low.at(1), bounds.high.at(1)) = (bounds.high.at(1), bounds.low.at(1))
let center = aabb.mid(bounds)
let (width, height, _) = aabb.size(bounds)
let path = drawable.path(
Expand All @@ -246,6 +247,7 @@
border-anchors: bounds != none,
radii: (width, height),
path: path,
transform: ctx.transform,
)
return (
ctx: ctx,
Expand Down