Skip to content

Commit

Permalink
Fix moving selections with arrow keys moving two pixels instead of one
Browse files Browse the repository at this point in the history
  • Loading branch information
OverloadedOrama committed Dec 3, 2024
1 parent ff5713a commit b48bb4a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const SPLASH_DIALOG_SCENE_PATH := "res://src/UI/Dialogs/SplashDialog.tscn"
var opensprite_file_selected := false
var redone := false
var is_quitting_on_save := false
var is_writing_text := false
var changed_projects_on_quit: Array[Project]
var cursor_image := preload("res://assets/graphics/cursor.png")
## Used to download an image when dragged and dropped directly from a browser into Pixelorama
Expand Down Expand Up @@ -202,7 +203,7 @@ func _ready() -> 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)
left_cursor.position = get_global_mouse_position() + Vector2(-32, 32)
right_cursor.position = get_global_mouse_position() + Vector2(32, 32)
Expand Down
1 change: 1 addition & 0 deletions src/Tools/UtilityTools/Text.gd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var text_edit: TextToolEdit:
set(value):
text_edit = value
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 font := FontVariation.new()
var font_name := "":
Expand Down

0 comments on commit b48bb4a

Please sign in to comment.