softdevteam/warmup_experiment

Tweak needed in rect collision algorithm

Closed this issue · 1 comments

snim2 commented

The current rect collision algorithm (used for inset placement) looks to see whether any data which overlaps the rect on the x-axis has its y-value between the top and bottom of the rect.

This fails to catch cases where a measurement passes straight through the rect, for example:

rect_collision_bug

snim2 commented

Also there are cases where the "tight" bounding box from the figure renderer clips the data. This is obvious if the bounding box is painted in. The rectangle collision algorithm needs to test this "tight" bounding box, not the smaller box that the inset is later resized to.