Skip to content

Commit

Permalink
Merge pull request #1036 from tangkong/bug_draw_div_0
Browse files Browse the repository at this point in the history
BUG: prevent PyDMDrawingLine from dividing by a length of 0
  • Loading branch information
YektaY authored Sep 26, 2023
2 parents cab9336 + 14c9223 commit d771043
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 d771043

Please sign in to comment.