From e5d0a661f7bb8900693838105fb9a753edcc2b99 Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Tue, 21 May 2024 03:01:23 +0300 Subject: [PATCH] Properly fix polygon select tool circle radius not scaling properly with zoom For real this time --- src/Tools/SelectionTools/PolygonSelect.gd | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Tools/SelectionTools/PolygonSelect.gd b/src/Tools/SelectionTools/PolygonSelect.gd index 32cc32b6b..82a5a1b26 100644 --- a/src/Tools/SelectionTools/PolygonSelect.gd +++ b/src/Tools/SelectionTools/PolygonSelect.gd @@ -74,10 +74,7 @@ func draw_preview() -> void: for line in _create_polylines(indicator): canvas.draw_polyline(PackedVector2Array(line), Color.BLACK) - var circle_radius := Global.camera.zoom / 10.0 - circle_radius.x = clampf(circle_radius.x, 2, circle_radius.x) - circle_radius.y = clampf(circle_radius.y, 2, circle_radius.y) - + var circle_radius := Vector2.ONE * (10.0 / Global.camera.zoom.x) if _last_position == _draw_points[0] and _draw_points.size() > 1: draw_empty_circle( canvas, Vector2(_draw_points[0]) + Vector2.ONE * 0.5, circle_radius, Color.BLACK @@ -230,5 +227,5 @@ func draw_empty_circle( draw_counter += 1 line_origin = line_end - line_end = circle_radius.rotated(deg_to_rad(360)) + circle_center + line_end = circle_radius.rotated(TAU) + circle_center canvas.draw_line(line_origin, line_end, color)