[GRASS-SVN] r33292 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Sep 6 07:29:10 EDT 2008


Author: martinl
Date: 2008-09-06 07:29:10 -0400 (Sat, 06 Sep 2008)
New Revision: 33292

Modified:
   grass/trunk/gui/wxpython/gui_modules/mapdisp.py
Log:
wxGUI: bug fix - trac #274: vdigit: cursor and vertex are apart when moving vertices
(merge from devbr6, r33291)


Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2008-09-06 11:24:54 UTC (rev 33291)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2008-09-06 11:29:10 UTC (rev 33292)
@@ -1393,12 +1393,14 @@
 
             if hasattr(self, "moveBegin"):
                 if len(digitClass.driver.GetSelected()) == 0:
-                    self.moveCoords = pos2
+                    self.moveCoords = pos1 # left down
+                    self.moveBegin = pos2 # left up
                 else:
-                    dx = pos2[0] - pos1[0]
+                    dx = pos2[0] - pos1[0] ### ???
                     dy = pos2[1] - pos1[1]
                     self.moveCoords = (self.moveCoords[0] + dx,
                                        self.moveCoords[1] + dy)
+                
                 # eliminate initial mouse moving efect
                 self.mouse['begin'] = self.mouse['end'] 
 
@@ -1704,10 +1706,13 @@
             if digitToolbar.GetAction() in ["moveLine", "moveVertex"] and \
                     hasattr(self, "moveBegin"):
 
+                pFrom = self.moveCoords
+                pBegin = self.moveBegin
                 pTo = self.Pixel2Cell(event.GetPositionTuple())
-                pFrom = self.moveCoords
-                move = (pTo[0]-pFrom[0], pTo[1]-pFrom[1])
                 
+                move = (pTo[0]-pFrom[0]-(pBegin[0]-pFrom[0]),
+                        pTo[1]-pFrom[1]-(pBegin[1]-pFrom[1]))
+                
                 if digitToolbar.GetAction() == "moveLine":
                     # move line
                     if digitClass.MoveSelectedLines(move) < 0:
@@ -1956,8 +1961,8 @@
                     and hasattr(self, "moveBegin"):
                 dx = self.mouse['end'][0] - self.mouse['begin'][0]
                 dy = self.mouse['end'][1] - self.mouse['begin'][1]
-                self.moveBegin[0] += dx
-                self.moveBegin[1] += dy
+                ### self.moveBegin[0] += dx
+                ### self.moveBegin[1] += dy
                 if len(self.moveIds) > 0:
                     # draw lines on new position
                     if digitToolbar.GetAction() == "moveLine":



More information about the grass-commit mailing list