From 8df293b4f5e6c8bf846f803dd44af254bd33f11a Mon Sep 17 00:00:00 2001 From: Sebastian Morr Date: Thu, 15 Oct 2020 16:49:28 +0200 Subject: [PATCH] Repair zooming! _unhandled_input is magic! --- repository.gd | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/repository.gd b/repository.gd index e6443e0..1a2a879 100644 --- a/repository.gd +++ b/repository.gd @@ -40,12 +40,11 @@ func _process(_delta): if path: apply_forces() -#func _input(event): -# if mouse_inside: -# if event.is_action_pressed("zoom_out") and nodes.rect_scale.x > 0.3: -# nodes.rect_scale -= Vector2(0.05, 0.05) -# if event.is_action_pressed("zoom_in") and nodes.rect_scale.x < 2: -# nodes.rect_scale += Vector2(0.05, 0.05) +func _unhandled_input(event): + if event.is_action_pressed("zoom_out") and nodes.rect_scale.x > 0.3: + nodes.rect_scale -= Vector2(0.05, 0.05) + if event.is_action_pressed("zoom_in") and nodes.rect_scale.x < 2: + nodes.rect_scale += Vector2(0.05, 0.05) func there_is_a_git(): return shell.run("test -d .git && echo yes || echo no") == "yes\n"