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 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.Breaking changes
Rect::distance_to_pos
,distance_sq_to_pos
,signed_distance_to_pos
now all returnf32::INFINITY
if the rectangle is negative.