Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LegendHiglighter hit detection #897

Merged
merged 1 commit into from
May 16, 2023
Merged

Conversation

corranwebster
Copy link
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.
@@ -427,7 +427,7 @@ def get_preferred_size(self):
# We need a dummy GC in order to get font metrics
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
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
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