mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-07 10:59:49 +00:00
Fix cursor always being a cross on the canvas even if it's toggled off
This commit is contained in:
parent
f7e866e9cb
commit
d26d1e294b
|
@ -101,7 +101,12 @@ func _input(event: InputEvent) -> void:
|
||||||
if gizmo:
|
if gizmo:
|
||||||
Global.main_viewport.mouse_default_cursor_shape = gizmo.get_cursor()
|
Global.main_viewport.mouse_default_cursor_shape = gizmo.get_cursor()
|
||||||
else:
|
else:
|
||||||
Global.main_viewport.mouse_default_cursor_shape = Input.CURSOR_CROSS
|
var cursor := Control.CURSOR_ARROW
|
||||||
|
if Global.cross_cursor:
|
||||||
|
cursor = Control.CURSOR_CROSS
|
||||||
|
|
||||||
|
if Global.main_viewport.mouse_default_cursor_shape != cursor:
|
||||||
|
Global.main_viewport.mouse_default_cursor_shape = cursor
|
||||||
|
|
||||||
if event is InputEventMouseButton and event.button_index == BUTTON_LEFT:
|
if event is InputEventMouseButton and event.button_index == BUTTON_LEFT:
|
||||||
if !Global.current_project.layers[Global.current_project.current_layer].can_layer_get_drawn():
|
if !Global.current_project.layers[Global.current_project.current_layer].can_layer_get_drawn():
|
||||||
|
@ -193,8 +198,8 @@ func _move_with_arrow_keys(event: InputEvent) -> void:
|
||||||
input.x = int(event.is_action("ui_right")) - int(event.is_action("ui_left"))
|
input.x = int(event.is_action("ui_right")) - int(event.is_action("ui_left"))
|
||||||
input.y = int(event.is_action("ui_down")) - int(event.is_action("ui_up"))
|
input.y = int(event.is_action("ui_down")) - int(event.is_action("ui_up"))
|
||||||
var move := input.rotated(stepify(Global.camera.rotation, PI / 2))
|
var move := input.rotated(stepify(Global.camera.rotation, PI / 2))
|
||||||
# These checks are needed to fix a bug where the selection boundaries
|
# These checks are needed to fix a bug where the selection got stuck
|
||||||
# got stuck to the canvas boundaries when they were 1px away from them
|
# to the canvas boundaries when they were 1px away from them
|
||||||
if is_equal_approx(abs(move.x), 0):
|
if is_equal_approx(abs(move.x), 0):
|
||||||
move.x = 0
|
move.x = 0
|
||||||
if is_equal_approx(abs(move.y), 0):
|
if is_equal_approx(abs(move.y), 0):
|
||||||
|
|
Loading…
Reference in a new issue