diff --git a/libs/canvas.py b/libs/canvas.py index cc681605..5d8e2b3e 100644 --- a/libs/canvas.py +++ b/libs/canvas.py @@ -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) diff --git a/libs/shape.py b/libs/shape.py index de366d27..165ef599 100644 --- a/libs/shape.py +++ b/libs/shape.py @@ -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):