Skip to content

Commit 2e76228

Browse files
committed
- fix bug
修复多边形移动时可能超出图片范围的问题。
1 parent 60ebf55 commit 2e76228

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

ISAT/widgets/canvas.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,12 @@
44
from PyQt5 import QtWidgets, QtGui, QtCore
55
from ISAT.widgets.polygon import Polygon, Vertex, PromptPoint, Line
66
from ISAT.configs import STATUSMode, CLICKMode, DRAWMode, CONTOURMode
7-
from PIL import Image
87
import numpy as np
98
import cv2
109
import time # 拖动鼠标描点
1110
import shapely
1211

1312

14-
15-
16-
1713
class AnnotationScene(QtWidgets.QGraphicsScene):
1814
def __init__(self, mainwindow):
1915
super(AnnotationScene, self).__init__()

ISAT/widgets/polygon.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def itemChange(self, change: 'QGraphicsItem.GraphicsItemChange', value: typing.A
179179
self.scene().selected_polygons_list.remove(self)
180180
self.scene().mainwindow.annos_dock_widget.set_selected(self) # 更新label面板
181181

182-
if change == QtWidgets.QGraphicsItem.GraphicsItemChange.ItemPositionHasChanged: # ItemPositionHasChanged
182+
if change == QtWidgets.QGraphicsItem.GraphicsItemChange.ItemPositionChange: # ItemPositionHasChanged
183183
bias = value
184184
l, t, b, r = self.boundingRect().left(), self.boundingRect().top(), self.boundingRect().bottom(), self.boundingRect().right()
185185
if l + bias.x() < 0: bias.setX(-l)

0 commit comments

Comments
 (0)