瀏覽代碼

wxGUI/vdigit: fix double click on the line/boundary after activate 'Move selected vertex' editing tool and switch to 'Edit selected line/boundary' editing tool (#1815)

Tomas Zigo 3 年之前
父節點
當前提交
99b1825865
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      gui/wxpython/vdigit/mapwindow.py

+ 4 - 3
gui/wxpython/vdigit/mapwindow.py

@@ -1236,9 +1236,10 @@ class VDigitWindow(BufferedMapWindow):
                     self.DrawLines(pdc=self.pdcTmp)
 
                 if action == "editLine":
-                    self.MouseDraw(
-                        pdc=self.pdcTmp, begin=self.Cell2Pixel(self.polycoords[-1])
-                    )
+                    if self.polycoords:
+                        self.MouseDraw(
+                            pdc=self.pdcTmp, begin=self.Cell2Pixel(self.polycoords[-1])
+                        )
 
             self.Refresh()  # TODO: use RefreshRect()
             self.mouse["begin"] = self.mouse["end"]