From 5d06af39b2f5bc893902da032fae76aa6a041072 Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Sun, 14 Jul 2024 16:02:16 +0300 Subject: [PATCH] Fix rulers being incorrect at the start --- src/UI/Canvas/Rulers/HorizontalRuler.gd | 3 +++ src/UI/Canvas/Rulers/VerticalRuler.gd | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/UI/Canvas/Rulers/HorizontalRuler.gd b/src/UI/Canvas/Rulers/HorizontalRuler.gd index 35f1a991c..e2651c27b 100644 --- a/src/UI/Canvas/Rulers/HorizontalRuler.gd +++ b/src/UI/Canvas/Rulers/HorizontalRuler.gd @@ -14,6 +14,9 @@ func _ready() -> void: Global.camera.zoom_changed.connect(queue_redraw) Global.camera.rotation_changed.connect(queue_redraw) Global.camera.offset_changed.connect(queue_redraw) + await get_tree().process_frame + await get_tree().process_frame + queue_redraw() func _gui_input(event: InputEvent) -> void: diff --git a/src/UI/Canvas/Rulers/VerticalRuler.gd b/src/UI/Canvas/Rulers/VerticalRuler.gd index e21589832..efc74db4a 100644 --- a/src/UI/Canvas/Rulers/VerticalRuler.gd +++ b/src/UI/Canvas/Rulers/VerticalRuler.gd @@ -14,6 +14,9 @@ func _ready() -> void: Global.camera.zoom_changed.connect(queue_redraw) Global.camera.rotation_changed.connect(queue_redraw) Global.camera.offset_changed.connect(queue_redraw) + await get_tree().process_frame + await get_tree().process_frame + queue_redraw() func _gui_input(event: InputEvent) -> void: