Skip to content

Conversation

@TihonovNV
Copy link
Contributor

Currently, PreparedPlot::hover always selects the item with the smallest dist_sq, which causes incorrect tooltip behavior when multiple items overlap.

For example:

  1. A rectangle always captures hover because its dist_sq is 0, even when points are drawn on top of it.
  2. Lines and points have inverse hover order (hover info is shown for the first drawn item).

This change updates the hover selection logic to prefer later-drawn (visually topmost) items when multiple elements are within interactive range.

Before change:

Screen.Recording.2025-10-18.at.19.24.35.mov

After change:

Screen.Recording.2025-10-18.at.19.27.43.mov

@emilk emilk added the include in changelog This change will be included in the changelog label Nov 4, 2025
Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@emilk emilk merged commit 613fe41 into emilk:main Nov 5, 2025
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

include in changelog This change will be included in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plot: Giving Points Hover Priority Over Lines

2 participants