mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-31 07:29:49 +00:00
Don't transform content if layer is locked or invisible
This commit is contained in:
parent
ab18e8bdb6
commit
680ab481f3
|
@ -28,6 +28,8 @@ func _input(event : InputEvent) -> void:
|
||||||
|
|
||||||
|
|
||||||
func draw_start(position : Vector2) -> void:
|
func draw_start(position : Vector2) -> void:
|
||||||
|
if !Global.current_project.layers[Global.current_project.current_layer].can_layer_get_drawn():
|
||||||
|
return
|
||||||
_start_pos = position
|
_start_pos = position
|
||||||
_offset = position
|
_offset = position
|
||||||
_undo_data = _get_undo_data()
|
_undo_data = _get_undo_data()
|
||||||
|
@ -37,6 +39,8 @@ func draw_start(position : Vector2) -> void:
|
||||||
|
|
||||||
|
|
||||||
func draw_move(position : Vector2) -> void:
|
func draw_move(position : Vector2) -> void:
|
||||||
|
if !Global.current_project.layers[Global.current_project.current_layer].can_layer_get_drawn():
|
||||||
|
return
|
||||||
# This is true if content transformation has been confirmed (pressed Enter for example)
|
# This is true if content transformation has been confirmed (pressed Enter for example)
|
||||||
# while the content is being moved
|
# while the content is being moved
|
||||||
if _content_transformation_check != selection_node.is_moving_content:
|
if _content_transformation_check != selection_node.is_moving_content:
|
||||||
|
@ -59,6 +63,8 @@ func draw_move(position : Vector2) -> void:
|
||||||
|
|
||||||
|
|
||||||
func draw_end(position : Vector2) -> void:
|
func draw_end(position : Vector2) -> void:
|
||||||
|
if !Global.current_project.layers[Global.current_project.current_layer].can_layer_get_drawn():
|
||||||
|
return
|
||||||
if _start_pos != Vector2.INF and _content_transformation_check == selection_node.is_moving_content:
|
if _start_pos != Vector2.INF and _content_transformation_check == selection_node.is_moving_content:
|
||||||
if Tools.shift: # Snap to axis
|
if Tools.shift: # Snap to axis
|
||||||
var angle := position.angle_to_point(_start_pos)
|
var angle := position.angle_to_point(_start_pos)
|
||||||
|
|
|
@ -75,6 +75,8 @@ func draw_start(position : Vector2) -> void:
|
||||||
if selection_position.y < 0:
|
if selection_position.y < 0:
|
||||||
offsetted_pos.y -= selection_position.y
|
offsetted_pos.y -= selection_position.y
|
||||||
if offsetted_pos.x >= 0 and offsetted_pos.y >= 0 and project.selection_bitmap.get_bit(offsetted_pos) and (!Tools.control or Tools.alt) and !Tools.shift and !_ongoing_selection:
|
if offsetted_pos.x >= 0 and offsetted_pos.y >= 0 and project.selection_bitmap.get_bit(offsetted_pos) and (!Tools.control or Tools.alt) and !Tools.shift and !_ongoing_selection:
|
||||||
|
if !Global.current_project.layers[Global.current_project.current_layer].can_layer_get_drawn():
|
||||||
|
return
|
||||||
# Move current selection
|
# Move current selection
|
||||||
_move = true
|
_move = true
|
||||||
if Tools.alt: # Move selection without content
|
if Tools.alt: # Move selection without content
|
||||||
|
|
|
@ -105,6 +105,8 @@ func _input(event : InputEvent) -> void:
|
||||||
Global.main_viewport.mouse_default_cursor_shape = Input.CURSOR_CROSS
|
Global.main_viewport.mouse_default_cursor_shape = Input.CURSOR_CROSS
|
||||||
|
|
||||||
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():
|
||||||
|
return
|
||||||
if event.pressed:
|
if event.pressed:
|
||||||
if gizmo:
|
if gizmo:
|
||||||
Global.has_focus = false
|
Global.has_focus = false
|
||||||
|
@ -165,6 +167,8 @@ func move_with_arrow_keys(event : InputEvent) -> void:
|
||||||
return
|
return
|
||||||
|
|
||||||
if Global.current_project.has_selection:
|
if Global.current_project.has_selection:
|
||||||
|
if !Global.current_project.layers[Global.current_project.current_layer].can_layer_get_drawn():
|
||||||
|
return
|
||||||
if is_action_direction_pressed(event) and !arrow_key_move:
|
if is_action_direction_pressed(event) and !arrow_key_move:
|
||||||
arrow_key_move = true
|
arrow_key_move = true
|
||||||
if Input.is_key_pressed(KEY_ALT):
|
if Input.is_key_pressed(KEY_ALT):
|
||||||
|
|
Loading…
Reference in a new issue