Skip to content

Fix LegendHiglighter hit detection#897

Merged
corranwebster merged 1 commit into
mainfrom
fix/legend-highlighter
May 16, 2023
Merged

Fix LegendHiglighter hit detection#897
corranwebster merged 1 commit into
mainfrom
fix/legend-highlighter

Conversation

@corranwebster
Copy link
Copy Markdown
Contributor

This fixes Legend.get_label_at() to return the entire legend label region, including icon, which then allows LegendHightlighter to use the actual mouse position to perform it's hit detection.

Fixes #825

This fixes Legend.get_label_at() to return the entire legend label region,
including icon, which then allows LegendHightlighter to use the actual mouse
position to perform it's hit detection.
Comment thread chaco/overlays/legend.py
dummy_gc = font_metrics_provider()
label_sizes = array(
[label.get_width_height(dummy_gc) for label in labels]
[label.get_bounding_box(dummy_gc) for label in labels]
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This will correctly handle labels at an angle..

Copy link
Copy Markdown
Member

@dpinte dpinte left a comment

Choose a reason for hiding this comment

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

👍

@corranwebster corranwebster merged commit 7130f50 into main May 16, 2023
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.

issue with LegendHighlighter tool

2 participants