canselcik/libremarkable

Removing an element does not remove the active region

Eeems opened this issue · 3 comments

Eeems commented

When you remove a named element from the ApplicationContext it stops drawing the element, but if you had an onclick registered, there is still an active region where the element used to be displayed.

I remember this peculiar behavior. This is definitely a bug, at least something that doesn't work the way one would expect it to.

You can work around it by invoking remove_active_region_at_point with any point your element was occupying.

Basically the ActiveRegionHandler in question doesn't get removed from the QuadTree<ActiveRegionHandler> that is active_regions when an element is removed.

Eeems commented

@canselcik That's what I ended up doing after looking through your code
https://github.com/Eeems/oxidize/blob/master/src/bin/corrode.rs#L204-L216

This should probably be fixed before 0.6.0 releases