Skip to content

Commit

Permalink
BUG: prevent PyDMDrawingLine from dividing by a length of 0
Browse files Browse the repository at this point in the history
  • Loading branch information
tangkong committed Sep 26, 2023
1 parent f3fa59e commit 14c9223
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pydm/widgets/drawing.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ def _arrow_points(startpoint, endpoint, height, width):
diff_x = startpoint.x() - endpoint.x()
diff_y = startpoint.y() - endpoint.y()

length = math.sqrt(diff_x**2 + diff_y**2)
length = max(math.sqrt(diff_x**2 + diff_y**2), 1.0)

norm_x = diff_x / length
norm_y = diff_y / length
Expand Down

0 comments on commit 14c9223

Please sign in to comment.