christolliday / limn

Experimental cross platform GUI library
Other
404 stars 19 forks source link

circles: slider position jumps after end DragEvent #60

Closed tones111 closed 6 years ago

tones111 commented 6 years ago

To reproduce: Click in the drawing area to create a new circle click, drag, and release the slider handle Note that the slider jumps an additional drag displacement

This bisects down to b802b7ff7 The resize logic in the example seems strange. The circle size is grown size_change, that size is sent to the slider, and then the circle is resized back down.

This can also cause the slider value to exceed its bounds.

christolliday commented 6 years ago

Thanks for the bug report, got a little busy with other things so took me a while to look into this. Turns out it's caused by the new multi-event code not doing enough to distinguish different event types, specifically releasing the mouse button when the drag ends was interpreted as clicking on the slider bar before ending the drag, which would send another slider move event, offsetting it again by the difference you dragged.

I just made a fix (#64) for the slider bug but the multi-event code in general is still a bit hacky, it's on my todo list to clean it up.