提交 4ab0e9a7 编写于 作者: K Kentaro Wada

Minor fix

上级 ac5ae220
...@@ -9,4 +9,3 @@ ...@@ -9,4 +9,3 @@
.DS_Store .DS_Store
.idea/ .idea/
create_labelme_env.bat
# -*- mode: python -*- # -*- mode: python -*-
# vim: ft=python # vim: ft=python
block_cipher = None block_cipher = None
...@@ -32,7 +33,7 @@ exe = EXE( ...@@ -32,7 +33,7 @@ exe = EXE(
strip=False, strip=False,
upx=True, upx=True,
runtime_tmpdir=None, runtime_tmpdir=None,
console=True, console=False,
icon='labelme/icons/icon.ico', icon='labelme/icons/icon.ico',
) )
app = BUNDLE( app = BUNDLE(
......
...@@ -52,7 +52,7 @@ class MainWindow(QtWidgets.QMainWindow): ...@@ -52,7 +52,7 @@ class MainWindow(QtWidgets.QMainWindow):
output=None, output=None,
output_file=None, output_file=None,
output_dir=None, output_dir=None,
): ):
if output is not None: if output is not None:
logger.warning( logger.warning(
'argument output is deprecated, use output_file instead' 'argument output is deprecated, use output_file instead'
...@@ -340,10 +340,13 @@ class MainWindow(QtWidgets.QMainWindow): ...@@ -340,10 +340,13 @@ class MainWindow(QtWidgets.QMainWindow):
self.tr('Add point to the nearest edge'), self.tr('Add point to the nearest edge'),
enabled=False, enabled=False,
) )
removePoint = action(
removePoint = action('Remove Selected Point', self.canvas.removeSelectedPoint, text='Remove Selected Point',
None, 'edit', 'Remove selected point from polygon', slot=self.canvas.removeSelectedPoint,
enabled=False) icon='edit',
tip='Remove selected point from polygon',
enabled=False,
)
undo = action(self.tr('Undo'), self.undoShapeEdit, undo = action(self.tr('Undo'), self.undoShapeEdit,
shortcuts['undo'], 'undo', shortcuts['undo'], 'undo',
...@@ -802,9 +805,6 @@ class MainWindow(QtWidgets.QMainWindow): ...@@ -802,9 +805,6 @@ class MainWindow(QtWidgets.QMainWindow):
url = 'https://github.com/wkentaro/labelme/tree/master/examples/tutorial' # NOQA url = 'https://github.com/wkentaro/labelme/tree/master/examples/tutorial' # NOQA
webbrowser.open(url) webbrowser.open(url)
def toggleRemovePointEnabled(self, enabled):
self.actions.removePoint.setEnabled(enabled)
def toggleDrawingSensitive(self, drawing=True): def toggleDrawingSensitive(self, drawing=True):
"""Toggle drawing sensitive. """Toggle drawing sensitive.
......
auto_save: false auto_save: false
display_label_popup: true display_label_popup: true
instance_label_auto_increment: true instance_label_auto_increment: true
store_data: false store_data: true
keep_prev: false keep_prev: false
logger_level: info logger_level: info
......
...@@ -358,13 +358,12 @@ class Canvas(QtWidgets.QWidget): ...@@ -358,13 +358,12 @@ class Canvas(QtWidgets.QWidget):
self.repaint() self.repaint()
elif ev.button() == QtCore.Qt.LeftButton and self.selectedShapes: elif ev.button() == QtCore.Qt.LeftButton and self.selectedShapes:
self.overrideCursor(CURSOR_GRAB) self.overrideCursor(CURSOR_GRAB)
if self.movingShape: if self.movingShape and self.hShape:
# Only save if changes have actually been made index = self.shapes.index(self.hShape)
if self.hShape is not None: if (self.shapesBackups[-1][index].points !=
currentShapeIndex = self.shapes.index(self.hShape) self.shapes[index].points):
if not self.shapesBackups[-1][currentShapeIndex].points == self.shapes[currentShapeIndex].points: self.storeShapes()
self.storeShapes() self.shapeMoved.emit()
self.shapeMoved.emit()
def endMove(self, copy): def endMove(self, copy):
assert self.selectedShapes and self.selectedShapesCopy assert self.selectedShapes and self.selectedShapesCopy
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册