Browse Source

partly revert https://trac.osgeo.org/grass/changeset/48646 (changes related to wxnviz were probably made by mistake)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@48649 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 13 years ago
parent
commit
b6330b63b1
1 changed files with 15 additions and 14 deletions
  1. 15 14
      gui/wxpython/gui_modules/mapdisp.py

+ 15 - 14
gui/wxpython/gui_modules/mapdisp.py

@@ -404,9 +404,6 @@ class MapFrame(wx.Frame):
                                              Map = self.Map, tree = self.tree, lmgr = self._layerManager)
                                              Map = self.Map, tree = self.tree, lmgr = self._layerManager)
             self.MapWindow = self.MapWindow3D
             self.MapWindow = self.MapWindow3D
             self.MapWindow.SetCursor(self.cursors["default"])
             self.MapWindow.SetCursor(self.cursors["default"])
-            self.MapWindow3D.overlays = self.MapWindow2D.overlays
-            self.MapWindow3D.textdict = self.MapWindow2D.textdict
-            self.MapWindow3D.UpdateOverlays()
             
             
             # add Nviz notebookpage
             # add Nviz notebookpage
             self._layerManager.AddNvizTools()
             self._layerManager.AddNvizTools()
@@ -428,8 +425,6 @@ class MapFrame(wx.Frame):
             self.MapWindow3D.GetDisplay().Init()
             self.MapWindow3D.GetDisplay().Init()
             del os.environ['GRASS_REGION']
             del os.environ['GRASS_REGION']
             
             
-            self.MapWindow3D.UpdateOverlays()
-            
             # switch from MapWindow to MapWindowGL
             # switch from MapWindow to MapWindowGL
             self._mgr.GetPane('2d').Hide()
             self._mgr.GetPane('2d').Hide()
             self._mgr.GetPane('3d').Show()
             self._mgr.GetPane('3d').Show()
@@ -1861,6 +1856,7 @@ class MapFrame(wx.Frame):
         """
         """
         if self.MapWindow.dragid > -1:
         if self.MapWindow.dragid > -1:
             id = self.MapWindow.dragid
             id = self.MapWindow.dragid
+            self.MapWindow.dragid = -1
         else:
         else:
             # index for overlay layer in render
             # index for overlay layer in render
             if len(self.MapWindow.textdict.keys()) > 0:
             if len(self.MapWindow.textdict.keys()) > 0:
@@ -1881,23 +1877,28 @@ class MapFrame(wx.Frame):
             # delete object if it has no text or is not active
             # delete object if it has no text or is not active
             if text == '' or active == False:
             if text == '' or active == False:
                 try:
                 try:
-                    self.MapWindow.pdc.ClearId(id)
-                    self.MapWindow.pdc.RemoveId(id)
+                    self.MapWindow2D.pdc.ClearId(id)
+                    self.MapWindow2D.pdc.RemoveId(id)
                     del self.MapWindow.textdict[id]
                     del self.MapWindow.textdict[id]
+                    if self.IsPaneShown('3d'):
+                        self.MapWindow3D.UpdateOverlays()
+                        self.MapWindow.UpdateMap()
+                    else:
+                        self.MapWindow2D.UpdateMap(render = False, renderVector = False)
                 except:
                 except:
                     pass
                     pass
                 return
                 return
 
 
-            self.MapWindow.pdc.ClearId(id)
-            self.MapWindow.pdc.SetId(id)
+            
             self.MapWindow.textdict[id] = self.dialogs['text'].GetValues()
             self.MapWindow.textdict[id] = self.dialogs['text'].GetValues()
-##            if self.MapWindow3D:
-##                self.MapWindow3D.textdict[id] = self.dialogs['text'].GetValues()
-                
             
             
-            self.MapWindow2D.UpdateMap(render = False, renderVector = False)
-            if self.MapWindow3D:
+            if self.IsPaneShown('3d'):
                 self.MapWindow3D.UpdateOverlays()
                 self.MapWindow3D.UpdateOverlays()
+                self.MapWindow3D.UpdateMap()
+            else:
+                self.MapWindow2D.pdc.ClearId(id)
+                self.MapWindow2D.pdc.SetId(id)
+                self.MapWindow2D.UpdateMap(render = False, renderVector = False)
             
             
         self.MapWindow.mouse['use'] = 'pointer'
         self.MapWindow.mouse['use'] = 'pointer'