Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
a `group` (#930)
- Added a new element `svg-path` that accepts a subset of SVG
commands to construct paths
- Fixed a bug with `brace` and `flip: true` (#1017)

# 0.4.2
- The `tree` element now has a `anchor:` argument to position the tree (#929)
Expand Down
Binary file modified manual.pdf
Binary file not shown.
8 changes: 6 additions & 2 deletions src/lib/decorations/brace.typ
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,15 @@
}
}, close: style.taper, stroke: style.stroke, fill: style.fill)

// Account for flip when positioning anchors
let anchor-amplitude = style.amplitude * (if style.flip { -1 } else { 1 })
let anchor-offset = style.content-offset * (if style.flip { -1 } else { 1 })

anchor("start", (0, 0))
anchor("default", (width / 2, 0))
anchor("end", (width, 0))
anchor("spike", (width / 2, style.amplitude))
anchor("content", (width / 2, style.amplitude + style.content-offset))
anchor("spike", (width / 2, anchor-amplitude))
anchor("content", (width / 2, anchor-amplitude + anchor-offset))

draw.move-to(end)
})
Expand Down
Binary file modified tests/decorations/ref/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.