From cdf50ce00d60514ec413aba2668a42af15bf3bbd Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Tue, 30 Jul 2024 19:43:19 +0300 Subject: [PATCH] Fix zoom tool mode doing the opposite of what it says --- src/Tools/UtilityTools/Zoom.gd | 12 ++++++------ src/Tools/UtilityTools/Zoom.tscn | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Tools/UtilityTools/Zoom.gd b/src/Tools/UtilityTools/Zoom.gd index fda2cb90c..2fa158af3 100644 --- a/src/Tools/UtilityTools/Zoom.gd +++ b/src/Tools/UtilityTools/Zoom.gd @@ -1,8 +1,10 @@ extends BaseTool +enum ZoomMode { ZOOM_OUT, ZOOM_IN } + var _relative: Vector2 -var _prev_mode := 0 -var _zoom_mode := 0 +var _prev_mode := ZoomMode.ZOOM_OUT +var _zoom_mode := ZoomMode.ZOOM_OUT func _input(event: InputEvent) -> void: @@ -19,7 +21,7 @@ func _input(event: InputEvent) -> void: _zoom_mode = $ModeOptions.selected -func _on_ModeOptions_item_selected(id: int) -> void: +func _on_ModeOptions_item_selected(id: ZoomMode) -> void: _zoom_mode = id update_config() save_config() @@ -34,9 +36,7 @@ func _on_100_pressed() -> void: func get_config() -> Dictionary: - return { - "zoom_mode": _zoom_mode, - } + return {"zoom_mode": _zoom_mode} func set_config(config: Dictionary) -> void: diff --git a/src/Tools/UtilityTools/Zoom.tscn b/src/Tools/UtilityTools/Zoom.tscn index 763713c17..cf1692c03 100644 --- a/src/Tools/UtilityTools/Zoom.tscn +++ b/src/Tools/UtilityTools/Zoom.tscn @@ -16,9 +16,9 @@ custom_minimum_size = Vector2(92, 0) layout_mode = 2 mouse_default_cursor_shape = 2 item_count = 2 -popup/item_0/text = "Zoom in" +popup/item_0/text = "Zoom out" popup/item_0/id = 0 -popup/item_1/text = "Zoom out" +popup/item_1/text = "Zoom in" popup/item_1/id = 1 [node name="Options" type="Label" parent="." index="4"]