Skip to content

Commit

Permalink
Update canvas.py
Browse files Browse the repository at this point in the history
Support for closing AI polygon when pressing enter
  • Loading branch information
RachamimYaakobov authored and wkentaro committed Jun 13, 2024
1 parent 4329343 commit ba5594a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion labelme/widgets/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def setHiding(self, enable=True):
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":
Expand Down

0 comments on commit ba5594a

Please sign in to comment.