Sfoglia il codice sorgente

Update canvas.py

Support for closing AI polygon when pressing enter
RachamimYaakobov 1 anno fa
parent
commit
ba5594abbf
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  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":