Skip to content

Commit

Permalink
text tool #458 #357 wide-enough margin regardless of the zoom level
Browse files Browse the repository at this point in the history
  • Loading branch information
maoschanz committed Jan 22, 2023
1 parent 6b1c8c8 commit 9e8419f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utilities/utilities_overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def utilities_show_composite_overlay(ccontext, thickness=1, x_press=None, y_pres
x1, y1, x2, y2 = ccontext.path_extents()
radius = _get_radius((x2 - x1), (y2 - y1), thickness)

radius_with_margin = (radius + 10) * 1.2
# Empirical way to get a wide-enough margin regardless of the zoom level
radius_with_margin = (radius + 13 * thickness) * 1.2
ccontext.move_to(x1 - radius_with_margin, y1 - radius_with_margin)
ccontext.line_to(x2 + radius_with_margin, y1 - radius_with_margin)
ccontext.line_to(x2 + radius_with_margin, y2 + radius_with_margin)
Expand Down

0 comments on commit 9e8419f

Please sign in to comment.