From 482455785986a00f66ccd764f2c4e3732ef30529 Mon Sep 17 00:00:00 2001 From: sumit Date: Tue, 2 Jun 2020 13:12:03 +0530 Subject: update end point of line --- src/main/python/shapes/line.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/python/shapes/line.py b/src/main/python/shapes/line.py index e6b1dd9..8c5149f 100644 --- a/src/main/python/shapes/line.py +++ b/src/main/python/shapes/line.py @@ -518,6 +518,10 @@ class Line(QGraphicsPathItem): updates points of line when grabber is moved :return: """ + if self.startGripItem: + self.points[0]= self.startPoint + if self.endGripItem: + self.points[len(self.points) - 1] = self.endPoint if self.startGripItem.m_location in ["left", "right"]: point = self.points[1] self.points[1] = QPointF(point.x(), self.startPoint.y()) @@ -527,7 +531,6 @@ class Line(QGraphicsPathItem): else: point = self.points[len(self.points) - 2] self.points[len(self.points) - 2] = QPointF(self.endPoint.x(), point.y()) - else: point = self.points[1] self.points[1] = QPointF(self.startPoint.x(), point.y()) @@ -538,6 +541,7 @@ class Line(QGraphicsPathItem): point = self.points[len(self.points) - 2] self.points[len(self.points) - 2] = QPointF(self.endPoint.x(), point.y()) + def shape(self): """generates outline for path """ -- cgit