1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Fix zoom tool mode doing the opposite of what it says

This commit is contained in:
Emmanouil Papadeas 2024-07-30 19:43:19 +03:00
parent 1d82bd95e5
commit cdf50ce00d
2 changed files with 8 additions and 8 deletions

View file

@ -1,8 +1,10 @@
extends BaseTool extends BaseTool
enum ZoomMode { ZOOM_OUT, ZOOM_IN }
var _relative: Vector2 var _relative: Vector2
var _prev_mode := 0 var _prev_mode := ZoomMode.ZOOM_OUT
var _zoom_mode := 0 var _zoom_mode := ZoomMode.ZOOM_OUT
func _input(event: InputEvent) -> void: func _input(event: InputEvent) -> void:
@ -19,7 +21,7 @@ func _input(event: InputEvent) -> void:
_zoom_mode = $ModeOptions.selected _zoom_mode = $ModeOptions.selected
func _on_ModeOptions_item_selected(id: int) -> void: func _on_ModeOptions_item_selected(id: ZoomMode) -> void:
_zoom_mode = id _zoom_mode = id
update_config() update_config()
save_config() save_config()
@ -34,9 +36,7 @@ func _on_100_pressed() -> void:
func get_config() -> Dictionary: func get_config() -> Dictionary:
return { return {"zoom_mode": _zoom_mode}
"zoom_mode": _zoom_mode,
}
func set_config(config: Dictionary) -> void: func set_config(config: Dictionary) -> void:

View file

@ -16,9 +16,9 @@ custom_minimum_size = Vector2(92, 0)
layout_mode = 2 layout_mode = 2
mouse_default_cursor_shape = 2 mouse_default_cursor_shape = 2
item_count = 2 item_count = 2
popup/item_0/text = "Zoom in" popup/item_0/text = "Zoom out"
popup/item_0/id = 0 popup/item_0/id = 0
popup/item_1/text = "Zoom out" popup/item_1/text = "Zoom in"
popup/item_1/id = 1 popup/item_1/id = 1
[node name="Options" type="Label" parent="." index="4"] [node name="Options" type="Label" parent="." index="4"]