Repository navigation
chart: Start a pie leader line at the lifted slice edge - #3121
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A labeled pie slice lifts
HOVER_LIFT(6px) past its outer radius while thecursor 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_gapsmaller than the lift.Nothing changes when a chart is not hovered, or when it has no
label.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 bluefill is present before and gone after.
Checklist
cargo runfor story tests related to the changes.