summaryrefslogtreecommitdiff
path: root/src/main/python/shapes
diff options
context:
space:
mode:
authorBlaine2020-06-02 18:02:03 +0530
committerBlaine2020-06-03 15:25:33 +0530
commitbfda61462a7c993efc8ed5bf3583f68601c6c074 (patch)
tree520bf922da8eccceb2aa64310baec3ec44ffbc4e /src/main/python/shapes
parent5bf8f7e70f49e0af4939e5bf6ef71053726cc970 (diff)
downloadChemical-PFD-bfda61462a7c993efc8ed5bf3583f68601c6c074.tar.gz
Chemical-PFD-bfda61462a7c993efc8ed5bf3583f68601c6c074.tar.bz2
Chemical-PFD-bfda61462a7c993efc8ed5bf3583f68601c6c074.zip
reverse dir fix
Diffstat (limited to 'src/main/python/shapes')
-rw-r--r--src/main/python/shapes/line.py22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/main/python/shapes/line.py b/src/main/python/shapes/line.py
index d1e3124..e0e3fae 100644
--- a/src/main/python/shapes/line.py
+++ b/src/main/python/shapes/line.py
@@ -210,15 +210,29 @@ class Line(QGraphicsPathItem):
if x == x1 == x2:
#vertical
if min(y1, y2) <= y < max(y1, y2):
- path.lineTo(point - QPointF(0, 8))
+ bool = y2>y1
+ if bool:
+ path.lineTo(point - QPointF(0, 8))
+ else:
+ path.lineTo(point + QPointF(0, 8))
path.arcTo(QRectF(x-8, y-8, 16, 16), 90, -180)
- path.moveTo(point + QPointF(0, 8))
+ if bool:
+ path.moveTo(point + QPointF(0, 8))
+ else:
+ path.moveTo(point - QPointF(0, 8))
elif y == y1 == y2:
#horizontal
if min(x1, x2) <= x < max(x1, x2):
- path.lineTo(point - QPointF(8, 0))
+ bool = x2>x1
+ if bool:
+ path.lineTo(point - QPointF(8, 0))
+ else:
+ path.lineTo(point - QPointF(8, 0))
path.arcTo(QRectF(x-8, y-8, 16, 16), 180, 180)
- path.moveTo(point + QPointF(8, 0))
+ if bool:
+ path.moveTo(point + QPointF(8, 0))
+ else:
+ path.lineTo(point - QPointF(8, 0))
path.lineTo(self.points[i+1])
painter.drawPath(path)