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

Fix moving selections with arrow keys moving two pixels instead of one

This commit is contained in:
Emmanouil Papadeas 2024-12-04 01:19:45 +02:00
parent ff5713ae91
commit b48bb4a094
2 changed files with 3 additions and 1 deletions

View file

@ -5,6 +5,7 @@ const SPLASH_DIALOG_SCENE_PATH := "res://src/UI/Dialogs/SplashDialog.tscn"
var opensprite_file_selected := false var opensprite_file_selected := false
var redone := false var redone := false
var is_quitting_on_save := false var is_quitting_on_save := false
var is_writing_text := false
var changed_projects_on_quit: Array[Project] var changed_projects_on_quit: Array[Project]
var cursor_image := preload("res://assets/graphics/cursor.png") var cursor_image := preload("res://assets/graphics/cursor.png")
## Used to download an image when dragged and dropped directly from a browser into Pixelorama ## Used to download an image when dragged and dropped directly from a browser into Pixelorama
@ -202,7 +203,7 @@ func _ready() -> void:
func _input(event: InputEvent) -> void: func _input(event: InputEvent) -> void:
if event is InputEventKey and is_instance_valid(Global.main_viewport): if is_writing_text and event is InputEventKey and is_instance_valid(Global.main_viewport):
Global.main_viewport.get_child(0).push_input(event) Global.main_viewport.get_child(0).push_input(event)
left_cursor.position = get_global_mouse_position() + Vector2(-32, 32) left_cursor.position = get_global_mouse_position() + Vector2(-32, 32)
right_cursor.position = get_global_mouse_position() + Vector2(32, 32) right_cursor.position = get_global_mouse_position() + Vector2(32, 32)

View file

@ -10,6 +10,7 @@ var text_edit: TextToolEdit:
set(value): set(value):
text_edit = value text_edit = value
confirm_buttons.visible = is_instance_valid(text_edit) confirm_buttons.visible = is_instance_valid(text_edit)
get_tree().current_scene.is_writing_text = is_instance_valid(text_edit)
var text_size := 16 var text_size := 16
var font := FontVariation.new() var font := FontVariation.new()
var font_name := "": var font_name := "":