Skip to content

chart: Start a pie leader line at the lifted slice edge - #3121

Merged
madcodelife merged 1 commit into
mainfrom
pie-label-line-hover-lift
Sep 18, 2026
Merged

madcodelife merged 1 commit into
mainfrom
pie-label-line-hover-lift

Conversation

@madcodelife

@madcodelife madcodelife commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Description

A labeled pie slice lifts HOVER_LIFT (6px) past its outer radius while the
cursor is on it, but the leader line still started at the resting radius. The
line is painted after the slices, so its first 6px sat on top of the slice it
points at: a pale hairline cutting into the fill at the arc edge, most visible
on a donut with a saturated slice.

The line now starts at the radius the slice actually reaches this frame, so it
meets the visible edge exactly as it does at rest and springs in and out with
the lift. The label anchor and text do not move, so nothing jitters under the
cursor, and the start is clamped to the label radius in case a caller sets a
label_gap smaller than the lift.

Nothing changes when a chart is not hovered, or when it has no label.

Before After
before_zoom after_zoom

How to Test

cargo run -- Chart, then hover the slices of the "Revenue by Region" donut.
The leader line of the hovered slice stays outside the fill through the whole
lift and settle; before this change it cut into the arc edge.

Verified by hovering the Europe slice and capturing the window with this
change and with main's version of the file: the hairline across the blue
fill is present before and gone after.

Checklist

  • I have read the CONTRIBUTING document and followed the guidelines.
  • Reviewed the changes in this PR and confirmed AI generated code (If any) is accurate.
  • Passed cargo run for story tests related to the changes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@madcodelife
madcodelife merged commit c1add35 into main Sep 18, 2026
20 of 22 checks passed
@madcodelife
madcodelife deleted the pie-label-line-hover-lift branch September 18, 2026 10:58
@huacnlee huacnlee added this to the 0.6.4 milestone Sep 18, 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