Skip to content

Commit 03a973f

Browse files
committed
arrow lengths are scaled consistently regardless of direction and aspect ratio (ax.set_aspect()). This fixes issue #2575.
1 parent 68fc687 commit 03a973f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tidy3d/components/geometry/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2292,7 +2292,9 @@ def _cb(event):
22922292
event.canvas.mpl_disconnect(arrow.set_shape_cb[0])
22932293

22942294
transform = arrow.axes.transData.transform
2295-
scale = transform((1, 0))[0] - transform((0, 0))[0]
2295+
scale_x = transform((1, 0))[0] - transform((0, 0))[0]
2296+
scale_y = transform((0, 1))[1] - transform((0, 0))[1]
2297+
scale = max(scale_x, scale_y) # <-- Hack: This is a somewhat arbitrary choice.
22962298
arrow_length = ARROW_LENGTH * event.canvas.figure.get_dpi() / scale
22972299

22982300
if bend_radius:

0 commit comments

Comments
 (0)