achuanle / umlet

Automatically exported from code.google.com/p/umlet
0 stars 0 forks source link

diagram movement while menu is opened -> elements "jump" around #186

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create new diagram and add one element (eg: Class)
2. move whole diagram several 100px to the right, by clicking 10x right to the 
bottom right corner of the class
3. open menu (eg "File") and start dragging the diagram to the right by 
clicking directly under the last entry

What is the expected output? What do you see instead?
Expected: the diagram moves the same amount of pixel your cursor moves
Instead: the first move moves the class to the left of your cursor and only 
further moves work as expected

Reason for the behavior:
Currently the UniversalListener (super listener for any diagram or gridelement 
listeners) stores the element position before drag-start on the MousePressed 
event (UniversalListener#53)
On mouseDragged() calls the displacement from this starting point is calculated 
and elements are moved by that amound

The error is that pressing the mouse on the diagram WHILE the menu is open 
doesn't trigger a MousePressed event (possibly Swing default behavior) and 
therefore the previously stored coordinates are the base for calculating the 
movement pixels. Therefore a wrong movement is calculated

Original issue reported on code.google.com by AFDiaX on 6 Jul 2014 at 9:59

GoogleCodeExporter commented 9 years ago
fixed in r1135

element movement is disabled if lasso is active (as before) AND after 
mouseReleased until next mousePressed

Original comment by AFDiaX on 6 Jul 2014 at 10:06

GoogleCodeExporter commented 9 years ago
r1136 corrects the initial value

Original comment by AFDiaX on 6 Jul 2014 at 10:08