On Wed, 2004-07-14 at 04:37, Arpad Biro wrote:
Hi,
This gives critical assert with current CVS (and earlier versions also):
- draw 2 objects
- drag one of them over the other, but do not release the mouse button
- press Esc
When the mouse is over an item, sp_select_context_item_handler is called rather than sp_select_context_root_handler for the button release.
item_handler seems to get confused and think it was a mouse-up event from a simple click, rather than a cancelled drag.
I suspect this is due to a copy-and-paste bug between sp_select_context_root_handler and sp_select_context_item_handler which are both massive and nearly (but not entirely) identical functions.
I've stuck in a workaround to cover this for the release, since properly refactoring that mess is likely to prove a couple days' work at least.
IMO we should redo the select tool (at least) as a simple state machine, using something fitting the GoF State pattern.
-mental