diff --git a/src/Autoload/DrawingAlgos.gd b/src/Autoload/DrawingAlgos.gd index a6320cdab..d56f6b526 100644 --- a/src/Autoload/DrawingAlgos.gd +++ b/src/Autoload/DrawingAlgos.gd @@ -235,7 +235,7 @@ func scale_image(width : int, height : int, interpolation : int) -> void: func centralize() -> void: - Global.canvas.selection.move_content_confirm() + Global.canvas.selection.transform_content_confirm() # Find used rect of the current frame (across all of the layers) var used_rect := Rect2() for cel in Global.current_project.frames[Global.current_project.current_frame].cels: @@ -257,7 +257,7 @@ func centralize() -> void: func crop_image(image : Image) -> void: - Global.canvas.selection.move_content_confirm() + Global.canvas.selection.transform_content_confirm() # Use first cel as a starting rectangle var used_rect : Rect2 = image.get_used_rect() diff --git a/src/Autoload/Global.gd b/src/Autoload/Global.gd index 9da113270..afbb70133 100644 --- a/src/Autoload/Global.gd +++ b/src/Autoload/Global.gd @@ -422,7 +422,7 @@ func title_changed(value : String) -> void: func project_changed(value : int) -> void: - canvas.selection.move_content_confirm() + canvas.selection.transform_content_confirm() current_project_index = value current_project = projects[value] current_project.change_project() diff --git a/src/Classes/ImageEffect.gd b/src/Classes/ImageEffect.gd index 8637a1be1..250402706 100644 --- a/src/Classes/ImageEffect.gd +++ b/src/Classes/ImageEffect.gd @@ -32,7 +32,7 @@ func _ready() -> void: func _about_to_show() -> void: - Global.canvas.selection.move_content_confirm() + Global.canvas.selection.transform_content_confirm() current_cel = Global.current_project.frames[Global.current_project.current_frame].cels[Global.current_project.current_layer].image current_frame.resize(Global.current_project.size.x, Global.current_project.size.y) current_frame.fill(Color(0, 0, 0, 0)) diff --git a/src/Classes/Project.gd b/src/Classes/Project.gd index 46e148fb5..5b0e9ca02 100644 --- a/src/Classes/Project.gd +++ b/src/Classes/Project.gd @@ -78,7 +78,7 @@ func _init(_frames := [], _name := tr("untitled"), _size := Vector2(64, 64)) -> func commit_undo() -> void: if Global.canvas.selection.is_moving_content: - Global.canvas.selection.move_content_cancel() + Global.canvas.selection.transform_content_cancel() else: undo_redo.undo() @@ -456,7 +456,7 @@ func remove_cel_buttons() -> void: func frame_changed(value : int) -> void: - Global.canvas.selection.move_content_confirm() + Global.canvas.selection.transform_content_confirm() current_frame = value Global.current_frame_mark_label.text = "%s/%s" % [str(current_frame + 1), frames.size()] @@ -488,7 +488,7 @@ func frame_changed(value : int) -> void: func layer_changed(value : int) -> void: - Global.canvas.selection.move_content_confirm() + Global.canvas.selection.transform_content_confirm() current_layer = value for container in Global.layers_container.get_children(): diff --git a/src/Tools/Bucket.gd b/src/Tools/Bucket.gd index 4ee233f63..0b5059d23 100644 --- a/src/Tools/Bucket.gd +++ b/src/Tools/Bucket.gd @@ -94,7 +94,7 @@ func update_pattern() -> void: func draw_start(position : Vector2) -> void: - Global.canvas.selection.move_content_confirm() + Global.canvas.selection.transform_content_confirm() if !Global.current_project.layers[Global.current_project.current_layer].can_layer_get_drawn() or !Global.current_project.tile_mode_rects[Global.TileMode.NONE].has_point(position): return if Global.current_project.has_selection and not Global.current_project.can_pixel_get_drawn(position): diff --git a/src/Tools/ColorSelect.gd b/src/Tools/ColorSelect.gd index e82a9943f..97f22cdf5 100644 --- a/src/Tools/ColorSelect.gd +++ b/src/Tools/ColorSelect.gd @@ -8,7 +8,7 @@ var undo_data : Dictionary func draw_start(_position : Vector2) -> void: - Global.canvas.selection.move_content_confirm() + Global.canvas.selection.transform_content_confirm() undo_data = Global.canvas.selection._get_undo_data(false) _intersect = Tools.shift && Tools.control _add = Tools.shift && !_intersect diff --git a/src/Tools/Eraser.gd b/src/Tools/Eraser.gd index f24d2adb2..847a4af48 100644 --- a/src/Tools/Eraser.gd +++ b/src/Tools/Eraser.gd @@ -24,7 +24,7 @@ func _init() -> void: func draw_start(position : Vector2) -> void: - Global.canvas.selection.move_content_confirm() + Global.canvas.selection.transform_content_confirm() update_mask() _changed = false _drawer.color_op.changed = false diff --git a/src/Tools/LightenDarken.gd b/src/Tools/LightenDarken.gd index acccf4155..a2d32eaaf 100644 --- a/src/Tools/LightenDarken.gd +++ b/src/Tools/LightenDarken.gd @@ -200,7 +200,7 @@ func update_strength() -> void: func draw_start(position : Vector2) -> void: - Global.canvas.selection.move_content_confirm() + Global.canvas.selection.transform_content_confirm() update_mask(false) _changed = false _drawer.color_op.changed = false diff --git a/src/Tools/MagicWand.gd b/src/Tools/MagicWand.gd index 20bea1851..8e08d7a9c 100644 --- a/src/Tools/MagicWand.gd +++ b/src/Tools/MagicWand.gd @@ -8,7 +8,7 @@ var undo_data : Dictionary func draw_start(_position : Vector2) -> void: - Global.canvas.selection.move_content_confirm() + Global.canvas.selection.transform_content_confirm() undo_data = Global.canvas.selection._get_undo_data(false) _intersect = Tools.shift && Tools.control _add = Tools.shift && !_intersect diff --git a/src/Tools/Move.gd b/src/Tools/Move.gd index e1cfd464a..27ed3364a 100644 --- a/src/Tools/Move.gd +++ b/src/Tools/Move.gd @@ -9,7 +9,7 @@ func draw_start(position : Vector2) -> void: _starting_pos = position _offset = position if Global.current_project.has_selection: - Global.canvas.selection.move_content_start() + Global.canvas.selection.transform_content_start() func draw_move(position : Vector2) -> void: diff --git a/src/Tools/Pencil.gd b/src/Tools/Pencil.gd index 967f45bae..1c3df8cea 100644 --- a/src/Tools/Pencil.gd +++ b/src/Tools/Pencil.gd @@ -46,7 +46,7 @@ func update_config() -> void: func draw_start(position : Vector2) -> void: - Global.canvas.selection.move_content_confirm() + Global.canvas.selection.transform_content_confirm() update_mask() _changed = false _drawer.color_op.changed = false diff --git a/src/Tools/RectSelect.gd b/src/Tools/RectSelect.gd index 210feb657..449ff215b 100644 --- a/src/Tools/RectSelect.gd +++ b/src/Tools/RectSelect.gd @@ -28,7 +28,7 @@ func _input(event : InputEvent) -> void: func draw_start(position : Vector2) -> void: - Global.canvas.selection.move_content_confirm() + Global.canvas.selection.transform_content_confirm() undo_data = Global.canvas.selection._get_undo_data(false) var selection_position : Vector2 = Global.canvas.selection.big_bounding_rectangle.position var offsetted_pos := position diff --git a/src/Tools/ShapeDrawer.gd b/src/Tools/ShapeDrawer.gd index dd36edbfa..ebfd07b43 100644 --- a/src/Tools/ShapeDrawer.gd +++ b/src/Tools/ShapeDrawer.gd @@ -53,6 +53,7 @@ func _get_shape_points_filled(_size: Vector2) -> PoolVector2Array: func draw_start(position : Vector2) -> void: + Global.canvas.selection.transform_content_confirm() update_mask() _start = position diff --git a/src/UI/Canvas/Selection.gd b/src/UI/Canvas/Selection.gd index 882fb1c52..1e0b5eb3b 100644 --- a/src/UI/Canvas/Selection.gd +++ b/src/UI/Canvas/Selection.gd @@ -80,9 +80,9 @@ func _input(event : InputEvent) -> void: if event is InputEventKey: if is_moving_content: # Temporary code if event.scancode == 16777221: # Enter - move_content_confirm() + transform_content_confirm() elif event.scancode == 16777217: # Escape - move_content_cancel() + transform_content_cancel() elif event is InputEventMouse: var gizmo : Gizmo if big_bounding_rectangle.size != Vector2.ZERO: @@ -104,7 +104,7 @@ func _input(event : InputEvent) -> void: if !is_moving_content: temp_rect = big_bounding_rectangle temp_bitmap = Global.current_project.selection_bitmap - move_content_start() + transform_content_start() Global.current_project.selection_offset = Vector2.ZERO if gizmo.type == Gizmo.Type.ROTATE: var img_size := max(original_preview_image.get_width(), original_preview_image.get_height()) @@ -310,7 +310,7 @@ func move_borders_end() -> void: update() -func move_content_start() -> void: +func transform_content_start() -> void: if !is_moving_content: is_moving_content = true undo_data = _get_undo_data(true) @@ -325,7 +325,7 @@ func move_content(move : Vector2) -> void: move_borders(move) -func move_content_confirm() -> void: +func transform_content_confirm() -> void: if !is_moving_content: return var project : Project = Global.current_project @@ -344,7 +344,7 @@ func move_content_confirm() -> void: update() -func move_content_cancel() -> void: +func transform_content_cancel() -> void: if preview_image.is_empty(): return var project : Project = Global.current_project @@ -505,7 +505,7 @@ func select_all() -> void: func invert() -> void: - move_content_confirm() + transform_content_confirm() var project := Global.current_project var _undo_data = _get_undo_data(false) var selection_bitmap_copy : BitMap = project.selection_bitmap.duplicate() @@ -522,7 +522,7 @@ func clear_selection(use_undo := false) -> void: var project := Global.current_project if !project.has_selection: return - move_content_confirm() + transform_content_confirm() var _undo_data = _get_undo_data(false) var selection_bitmap_copy : BitMap = project.selection_bitmap.duplicate() selection_bitmap_copy = project.resize_bitmap(selection_bitmap_copy, project.size) diff --git a/src/UI/Dialogs/ExportDialog.gd b/src/UI/Dialogs/ExportDialog.gd index 0186a2bce..c59165335 100644 --- a/src/UI/Dialogs/ExportDialog.gd +++ b/src/UI/Dialogs/ExportDialog.gd @@ -222,7 +222,7 @@ func set_export_progress_bar(value: float) -> void: func _on_ExportDialog_about_to_show() -> void: - Global.canvas.selection.move_content_confirm() + Global.canvas.selection.transform_content_confirm() # If we're on HTML5, don't let the user change the directory path if OS.get_name() == "HTML5": path_container.visible = false diff --git a/src/UI/Dialogs/ImageEffects/ResizeCanvas.gd b/src/UI/Dialogs/ImageEffects/ResizeCanvas.gd index 198cabf09..196e411d6 100644 --- a/src/UI/Dialogs/ImageEffects/ResizeCanvas.gd +++ b/src/UI/Dialogs/ImageEffects/ResizeCanvas.gd @@ -16,7 +16,7 @@ onready var preview_rect : TextureRect = $VBoxContainer/Preview func _on_ResizeCanvas_about_to_show() -> void: - Global.canvas.selection.move_content_confirm() + Global.canvas.selection.transform_content_confirm() image = Image.new() image.create(Global.current_project.size.x, Global.current_project.size.y, false, Image.FORMAT_RGBA8) image.lock() diff --git a/src/UI/Dialogs/ImageEffects/ScaleImage.gd b/src/UI/Dialogs/ImageEffects/ScaleImage.gd index 1d4ac430b..f4fa43264 100644 --- a/src/UI/Dialogs/ImageEffects/ScaleImage.gd +++ b/src/UI/Dialogs/ImageEffects/ScaleImage.gd @@ -12,7 +12,7 @@ onready var ratio_box : BaseButton = find_node("AspectRatioButton") func _on_ScaleImage_about_to_show() -> void: - Global.canvas.selection.move_content_confirm() + Global.canvas.selection.transform_content_confirm() width_value.value = Global.current_project.size.x height_value.value = Global.current_project.size.y width_value_perc.value = 100