fix a bug: creating a box with one point
This commit is contained in:
parent
fcffa12842
commit
95ff5062fe
@ -245,9 +245,9 @@ class Canvas(QWidget):
|
||||
self.current.addPoint(targetPos)
|
||||
self.current.addPoint(QPointF(minX, maxY))
|
||||
self.current.addPoint(initPos)
|
||||
self.current.close()
|
||||
self.line[0] = self.current[-1]
|
||||
if self.current.isClosed():
|
||||
self.finalise()
|
||||
self.finalise()
|
||||
elif not self.outOfPixmap(pos):
|
||||
self.current = Shape()
|
||||
self.current.addPoint(pos)
|
||||
|
||||
@ -67,9 +67,7 @@ class Shape(object):
|
||||
return False
|
||||
|
||||
def addPoint(self, point):
|
||||
if self.points and point == self.points[0]:
|
||||
self.close()
|
||||
else:
|
||||
if not self.reachMaxPoints():
|
||||
self.points.append(point)
|
||||
|
||||
def popPoint(self):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user