mirror of
https://github.com/PaddlePaddle/PaddleOCR.git
synced 2025-06-03 21:53:39 +08:00
Update move box
This commit is contained in:
parent
6887f45720
commit
f68f7df702
@ -885,7 +885,13 @@ class MainWindow(QMainWindow, WindowMixin):
|
||||
self.updateComboBox()
|
||||
|
||||
def updateBoxlist(self):
|
||||
for shape in self.canvas.selectedShapes+[self.canvas.hShape]:
|
||||
if self.canvas.hShape != None:
|
||||
for shape in self.canvas.selectedShapes + [self.canvas.hShape]:
|
||||
item = self.shapesToItemsbox[shape] # listitem
|
||||
text = [(int(p.x()), int(p.y())) for p in shape.points]
|
||||
item.setText(str(text))
|
||||
else:
|
||||
for shape in self.canvas.selectedShapes:
|
||||
item = self.shapesToItemsbox[shape] # listitem
|
||||
text = [(int(p.x()), int(p.y())) for p in shape.points]
|
||||
item.setText(str(text))
|
||||
|
@ -709,17 +709,19 @@ class Canvas(QWidget):
|
||||
self.update()
|
||||
elif key == Qt.Key_Return and self.canCloseShape():
|
||||
self.finalise()
|
||||
elif key == Qt.Key_Left and self.selectedShape:
|
||||
elif key == Qt.Key_Left and self.selectedShapes:
|
||||
self.moveOnePixel('Left')
|
||||
elif key == Qt.Key_Right and self.selectedShape:
|
||||
elif key == Qt.Key_Right and self.selectedShapes:
|
||||
self.moveOnePixel('Right')
|
||||
elif key == Qt.Key_Up and self.selectedShape:
|
||||
elif key == Qt.Key_Up and self.selectedShapes:
|
||||
self.moveOnePixel('Up')
|
||||
elif key == Qt.Key_Down and self.selectedShape:
|
||||
elif key == Qt.Key_Down and self.selectedShapes:
|
||||
self.moveOnePixel('Down')
|
||||
|
||||
def moveOnePixel(self, direction):
|
||||
# print(self.selectedShape.points)
|
||||
for i in range(len(self.selectedShapes)):
|
||||
self.selectedShape = self.selectedShapes[i]
|
||||
if direction == 'Left' and not self.moveOutOfBound(QPointF(-1.0, 0)):
|
||||
# print("move Left one pixel")
|
||||
self.selectedShape.points[0] += QPointF(-1.0, 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user