Skip to content

Commit

Permalink
Properly fix polygon select tool circle radius not scaling properly w…
Browse files Browse the repository at this point in the history
…ith zoom

For real this time
  • Loading branch information
OverloadedOrama committed May 21, 2024
1 parent 3f8799f commit e5d0a66
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Tools/SelectionTools/PolygonSelect.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

0 comments on commit e5d0a66

Please sign in to comment.