Fix for #2009 (empty rectangle issue)#2022
Fix for #2009 (empty rectangle issue)#2022Lehonti wants to merge 3 commits intoPintaProject:masterfrom
Conversation
|
Yeah this definitely contributes to the issue - we should have a common function for doing this rounding (it also happens inside the handle for the OnMouseMove event, which is inconsistent ) In my testing I was still able to occasionally get it to produce a zero-size rectangle, by tapping my laptop's trackpad while zoomed in. The logic in |
|
@cameronwhite I see. Maybe after these new changes it will work better |
|
Thanks! Having the common function is much nicer I can still reproduce the same issue though so I think it's somewhat separate from the rounding - being zoomed in far makes it much easier to hit. Maybe this needs to be handled at a lower level like BaseTool or the canvas event handlers though. Very likely there are other tools which also have similar assumptions that the "mouse up" event happens at the same position as the last "mouse move" event, and sending out an extra "mouse move" event could work? |
Closes #2009
Notice that
OnMouseDownrounds the coordinates andOnMouseUpdoesn't, so when testing for equality the coordinates are different, which shouldn't happen