Просмотр исходного кода

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 лет назад
Родитель
Сommit
fe87cd0e54
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      gui/wxpython/vdigit/mapwindow.py

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

@@ -1166,8 +1166,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']