Skip to content

Commit

Permalink
Use resetState for postprocess after deleting label file
Browse files Browse the repository at this point in the history
  • Loading branch information
wkentaro committed Feb 25, 2019
1 parent f41f332 commit 7f20578
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion labelme/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,7 @@ def deleteFile(self):
item = self.fileListWidget.currentItem()
item.setCheckState(Qt.Unchecked)

self.labelList.clear()
self.resetState()

# Message Dialogs. #
def hasLabels(self):
Expand Down
11 changes: 7 additions & 4 deletions labelme/widgets/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,13 @@ def selectedVertex(self):

def mouseMoveEvent(self, ev):
"""Update line with last point and current coordinates."""
if QT5:
pos = self.transformPos(ev.pos())
else:
pos = self.transformPos(ev.posF())
try:
if QT5:
pos = self.transformPos(ev.pos())
else:
pos = self.transformPos(ev.posF())
except AttributeError:
return

self.prevMovePoint = pos
self.restoreCursor()
Expand Down

0 comments on commit 7f20578

Please sign in to comment.