Skip to content

Commit a712170

Browse files
committed
arrow direction fix on active.
1 parent ee495e8 commit a712170

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

NodeGraphQt/widgets/pipe.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,14 @@ def draw_path(self, start_port, end_port, cursor_pos=None):
165165
path.cubicTo(ctr_point1, ctr_point2, pos2)
166166
self.setPath(path)
167167

168-
# Draw Arrow
169-
loc_pt = self.path().pointAtPercent(0.49)
170-
tgt_pt = self.path().pointAtPercent(0.51)
168+
# draw arrow
169+
if start_port.port_type == IN_PORT:
170+
loc_pt = self.path().pointAtPercent(0.49)
171+
tgt_pt = self.path().pointAtPercent(0.51)
172+
else:
173+
loc_pt = self.path().pointAtPercent(0.51)
174+
tgt_pt = self.path().pointAtPercent(0.49)
175+
171176
radians = math.atan2(tgt_pt.y() - loc_pt.y(), tgt_pt.x() - loc_pt.x())
172177
degrees = math.degrees(radians) - 90
173178
self.__arrow.setPos(self.path().pointAtPercent(0.5))

0 commit comments

Comments
 (0)