forked from emilk/egui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix buggy interaction with widgets outside of clip rect (emilk#4675)
This fixes a bug which sometimes would make it possible to interact with widgets that were outside the parent clip_rect. Interaction with a widget is done with the `interact_rect`, which is the intersection of the widget rect and the parent clip rect. If these rectangles are disjoint (the widget is outside the parent clip rect), this results in a _negative rectangle_ (a rectangle with a negative width and/or height). The distance tests for negative rectangles were broken, causing the bug. * This is part of solving emilk#4475 * It is also likely this would have solved emilk#4349 (which now has another fix for it) ### Breaking changes `Rect::distance_to_pos`, `distance_sq_to_pos`, `signed_distance_to_pos` now all return `f32::INFINITY` if the rectangle is negative.
- Loading branch information
1 parent
014327e
commit affcac7
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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