diff options
author | sumit | 2020-06-02 13:12:03 +0530 |
---|---|---|
committer | Blaine | 2020-06-03 15:25:33 +0530 |
commit | 172e96a0068d257986962f32ab67273bfa0200cd (patch) | |
tree | e58d0d076915992a6bebe12ea68a10aadd9676b9 /src/main | |
parent | 166376901be1006dee9ce96fd12f6b910b2e860c (diff) | |
download | Chemical-PFD-172e96a0068d257986962f32ab67273bfa0200cd.tar.gz Chemical-PFD-172e96a0068d257986962f32ab67273bfa0200cd.tar.bz2 Chemical-PFD-172e96a0068d257986962f32ab67273bfa0200cd.zip |
update end point of line
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/python/shapes/line.py | 6 |
1 files changed, 5 insertions, 1 deletions
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 """ |