Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r946 - trunk/src/org/tigris/gef/base/ModeModify.java

gef
Discussion topic

Back to topic list

svn commit: r946 - trunk/src/org/tigris/gef/base/ModeModify.java

Author mvw
Full name Michiel van der Wulp
Date 2006-11-15 09:54:10 PST
Message Author: mvw
Date: 2006-11-15 09:54:10-0800
New Revision: 946

Modified:
   trunk/src/org/tigris​/gef/base/ModeModify​.java

Log:
Fix for issue 292: ModeModify does not restrict to snap.

Modified: trunk/src/org/tigris​/gef/base/ModeModify​.java
Url: http://gef.tigris.or​g/source/browse/gef/​trunk/src/org/tigris​/gef/base/ModeModify​.java?view=diff&​rev=946&p1=trunk​/src/org/tigris/gef/​base/ModeModify.java​&p2=trunk/src/or​g/tigris/gef/base/Mo​deModify.java&r1​=945&r2=946
====================​====================​====================​==================
--- trunk/src/org/tigris​/gef/base/ModeModify​.java (original)
+++ trunk/src/org/tigris​/gef/base/ModeModify​.java 2006-11-15 09:54:10-0800
@@ -120,12 +120,12 @@
         }
 
         mouseEvent.consume();
- int mouseX = mouseEvent.getX();
- int mouseY = mouseEvent.getY();
- newMousePosition.x = mouseX;
- newMousePosition.y = mouseY;
- _deltaMouseX = mouseX - dragStartMousePosition.x;
- _deltaMouseY = mouseY - dragStartMousePosition.y;
+ Point p = mouseEvent.getPoint();
+ getEditor().snap(p); // only allow movement on snap positions
+ newMousePosition.x = p.x;
+ newMousePosition.y = p.y;
+ _deltaMouseX = p.x - dragStartMousePosition.x;
+ _deltaMouseY = p.y - dragStartMousePosition.y;
         if(!_dragInProcess && Math.abs(_deltaMouseX) < MIN_DELTA && Math.abs(_deltaMouseY) < MIN_DELTA) {
             return;
         }

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r946 - trunk/src/org/tigris/gef/base/ModeModify.java mvw Michiel van der Wulp 2006-11-15 09:54:10 PST
Messages per page: