Skip to content

Conversation

@CJerum
Copy link

@CJerum CJerum commented Jan 9, 2026

Problem

When flip: true is set on a brace, the brace is drawn pointing in the opposite direction, but the spike and content anchors were always positioned using positive amplitude values. This caused labels to appear on the wrong side of flipped braces.

Solution

This fix multiplies both amplitude and content-offset by -1 when flip is true, ensuring anchors are positioned correctly on both normal and flipped braces.

Related Issues

This is similar to the fix for flat-brace in PR #688, but applies to the regular brace function which was not included in that fix.

Testing

Tested with both horizontal and diagonal braces, with and without flip. Labels now correctly position on the appropriate side of the brace in all cases.

When flip: true, the brace is drawn pointing in the opposite direction,
but the spike and content anchors were always positioned using positive
amplitude values. This caused labels to appear on the wrong side of
flipped braces.

This fix multiplies both amplitude and content-offset by -1 when
flip is true, ensuring anchors are positioned correctly on both
normal and flipped braces.
@johannes-wolf johannes-wolf self-requested a review January 9, 2026 11:03
@johannes-wolf johannes-wolf added this to the 0.5.0 milestone Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants