1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-02-12 16:53:07 +00:00

Various small code improvements

This commit is contained in:
Emmanouil Papadeas 2025-02-10 03:04:42 +02:00
parent 7902465cf1
commit 1b71dd565a
5 changed files with 6 additions and 6 deletions

View file

@ -11,7 +11,7 @@ extends DockableLayoutNode
emit_tree_changed()
@export var current_tab: int:
get:
return int(clamp(_current_tab, 0, _names.size() - 1))
return clampi(_current_tab, 0, _names.size() - 1)
set(value):
if value != _current_tab:
_current_tab = value

View file

@ -444,7 +444,7 @@ func add_tool_button(t: Tool, insert_pos := -1) -> void:
if insert_pos > -1:
insert_pos = mini(insert_pos, _tool_buttons.get_child_count() - 1)
_tool_buttons.move_child(tool_button, insert_pos)
tool_button.pressed.connect(_tool_buttons._on_Tool_pressed.bind(tool_button))
tool_button.pressed.connect(_tool_buttons._on_tool_pressed.bind(tool_button))
func remove_tool(t: Tool) -> void:

View file

@ -1028,6 +1028,7 @@ unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
focus_mode = 2
mouse_default_cursor_shape = 2
theme_type_variation = &"ValueSlider"
nine_patch_stretch = true
stretch_margin_left = 3

View file

@ -87,10 +87,9 @@ func _on_CelButton_pressed() -> void:
if Input.is_action_just_released("left_mouse"):
Global.canvas.selection.transform_content_confirm()
var change_cel := true
var prev_curr_frame: int = project.current_frame
var prev_curr_layer: int = project.current_layer
if Input.is_action_pressed("shift"):
var prev_curr_frame := project.current_frame
var prev_curr_layer := project.current_layer
var frame_diff_sign := signi(frame - prev_curr_frame)
if frame_diff_sign == 0:
frame_diff_sign = 1

View file

@ -38,7 +38,7 @@ func _unhandled_input(event: InputEvent) -> void:
return
func _on_Tool_pressed(tool_pressed: BaseButton) -> void:
func _on_tool_pressed(tool_pressed: BaseButton) -> void:
var button := -1
button = MOUSE_BUTTON_LEFT if Input.is_action_just_released("left_mouse") else button
button = (