From 8ab4af10473aabc1a30f05a7c4ddc99db37d6d3e Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Mon, 16 Dec 2024 19:10:03 +0200 Subject: [PATCH] Fix curve in the curve edit node not redrawing immediately after adding a new point --- src/UI/Nodes/CurveEditor/CurveEdit.gd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/UI/Nodes/CurveEditor/CurveEdit.gd b/src/UI/Nodes/CurveEditor/CurveEdit.gd index d3163dd40..1a4571f8e 100644 --- a/src/UI/Nodes/CurveEditor/CurveEdit.gd +++ b/src/UI/Nodes/CurveEditor/CurveEdit.gd @@ -213,7 +213,8 @@ func _draw() -> void: var y := p1.y * omt3 + yac * omt2 * t * 3.0 + ybc * omt * t2 * 3.0 + p2.y * t3 p = transform_point(Vector2(x, y)) points.push_back(p) - draw_polyline(points, curve_color) + if points.size() > 1: + draw_polyline(points, curve_color) func _on_control_point_moved(index: int) -> void: @@ -245,6 +246,7 @@ func _on_gui_input(event: InputEvent) -> void: if event.button_index == MOUSE_BUTTON_LEFT and event.double_click: var new_point_position := reverse_transform_point(get_local_mouse_position()) curve.add_point(new_point_position, 0.0, 0.0) + queue_redraw() update_controls()