Преглед на файлове

Update canvas.py

Support for closing AI polygon when pressing enter
RachamimYaakobov преди 1 година
родител
ревизия
ba5594abbf
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      labelme/widgets/canvas.py

+ 1 - 1
labelme/widgets/canvas.py

@@ -540,7 +540,7 @@ class Canvas(QtWidgets.QWidget):
         self._hideBackround = self.hideBackround if enable else False
 
     def canCloseShape(self):
-        return self.drawing() and self.current and len(self.current) > 2
+        return self.drawing() and ((self.current and len(self.current) > 2) or self.createMode in ["ai_polygon", "ai_mask"])
 
     def mouseDoubleClickEvent(self, ev):
         if self.double_click != "close":