1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-19 01:29:49 +00:00

Rename move_content methods to transform_content

This commit is contained in:
Manolis Papadeas 2021-04-23 23:37:07 +03:00
parent 83d9800fc1
commit afd7cc43c9
17 changed files with 27 additions and 26 deletions

View file

@ -235,7 +235,7 @@ func scale_image(width : int, height : int, interpolation : int) -> void:
func centralize() -> 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) # Find used rect of the current frame (across all of the layers)
var used_rect := Rect2() var used_rect := Rect2()
for cel in Global.current_project.frames[Global.current_project.current_frame].cels: 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: 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 # Use first cel as a starting rectangle
var used_rect : Rect2 = image.get_used_rect() var used_rect : Rect2 = image.get_used_rect()

View file

@ -422,7 +422,7 @@ func title_changed(value : String) -> void:
func project_changed(value : int) -> void: func project_changed(value : int) -> void:
canvas.selection.move_content_confirm() canvas.selection.transform_content_confirm()
current_project_index = value current_project_index = value
current_project = projects[value] current_project = projects[value]
current_project.change_project() current_project.change_project()

View file

@ -32,7 +32,7 @@ func _ready() -> void:
func _about_to_show() -> 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_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.resize(Global.current_project.size.x, Global.current_project.size.y)
current_frame.fill(Color(0, 0, 0, 0)) current_frame.fill(Color(0, 0, 0, 0))

View file

@ -78,7 +78,7 @@ func _init(_frames := [], _name := tr("untitled"), _size := Vector2(64, 64)) ->
func commit_undo() -> void: func commit_undo() -> void:
if Global.canvas.selection.is_moving_content: if Global.canvas.selection.is_moving_content:
Global.canvas.selection.move_content_cancel() Global.canvas.selection.transform_content_cancel()
else: else:
undo_redo.undo() undo_redo.undo()
@ -456,7 +456,7 @@ func remove_cel_buttons() -> void:
func frame_changed(value : int) -> void: func frame_changed(value : int) -> void:
Global.canvas.selection.move_content_confirm() Global.canvas.selection.transform_content_confirm()
current_frame = value current_frame = value
Global.current_frame_mark_label.text = "%s/%s" % [str(current_frame + 1), frames.size()] 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: func layer_changed(value : int) -> void:
Global.canvas.selection.move_content_confirm() Global.canvas.selection.transform_content_confirm()
current_layer = value current_layer = value
for container in Global.layers_container.get_children(): for container in Global.layers_container.get_children():

View file

@ -94,7 +94,7 @@ func update_pattern() -> void:
func draw_start(position : Vector2) -> 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): 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 return
if Global.current_project.has_selection and not Global.current_project.can_pixel_get_drawn(position): if Global.current_project.has_selection and not Global.current_project.can_pixel_get_drawn(position):

View file

@ -8,7 +8,7 @@ var undo_data : Dictionary
func draw_start(_position : Vector2) -> 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) undo_data = Global.canvas.selection._get_undo_data(false)
_intersect = Tools.shift && Tools.control _intersect = Tools.shift && Tools.control
_add = Tools.shift && !_intersect _add = Tools.shift && !_intersect

View file

@ -24,7 +24,7 @@ func _init() -> void:
func draw_start(position : Vector2) -> void: func draw_start(position : Vector2) -> void:
Global.canvas.selection.move_content_confirm() Global.canvas.selection.transform_content_confirm()
update_mask() update_mask()
_changed = false _changed = false
_drawer.color_op.changed = false _drawer.color_op.changed = false

View file

@ -200,7 +200,7 @@ func update_strength() -> void:
func draw_start(position : Vector2) -> void: func draw_start(position : Vector2) -> void:
Global.canvas.selection.move_content_confirm() Global.canvas.selection.transform_content_confirm()
update_mask(false) update_mask(false)
_changed = false _changed = false
_drawer.color_op.changed = false _drawer.color_op.changed = false

View file

@ -8,7 +8,7 @@ var undo_data : Dictionary
func draw_start(_position : Vector2) -> 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) undo_data = Global.canvas.selection._get_undo_data(false)
_intersect = Tools.shift && Tools.control _intersect = Tools.shift && Tools.control
_add = Tools.shift && !_intersect _add = Tools.shift && !_intersect

View file

@ -9,7 +9,7 @@ func draw_start(position : Vector2) -> void:
_starting_pos = position _starting_pos = position
_offset = position _offset = position
if Global.current_project.has_selection: if Global.current_project.has_selection:
Global.canvas.selection.move_content_start() Global.canvas.selection.transform_content_start()
func draw_move(position : Vector2) -> void: func draw_move(position : Vector2) -> void:

View file

@ -46,7 +46,7 @@ func update_config() -> void:
func draw_start(position : Vector2) -> void: func draw_start(position : Vector2) -> void:
Global.canvas.selection.move_content_confirm() Global.canvas.selection.transform_content_confirm()
update_mask() update_mask()
_changed = false _changed = false
_drawer.color_op.changed = false _drawer.color_op.changed = false

View file

@ -28,7 +28,7 @@ func _input(event : InputEvent) -> void:
func draw_start(position : Vector2) -> 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) undo_data = Global.canvas.selection._get_undo_data(false)
var selection_position : Vector2 = Global.canvas.selection.big_bounding_rectangle.position var selection_position : Vector2 = Global.canvas.selection.big_bounding_rectangle.position
var offsetted_pos := position var offsetted_pos := position

View file

@ -53,6 +53,7 @@ func _get_shape_points_filled(_size: Vector2) -> PoolVector2Array:
func draw_start(position : Vector2) -> void: func draw_start(position : Vector2) -> void:
Global.canvas.selection.transform_content_confirm()
update_mask() update_mask()
_start = position _start = position

View file

@ -80,9 +80,9 @@ func _input(event : InputEvent) -> void:
if event is InputEventKey: if event is InputEventKey:
if is_moving_content: # Temporary code if is_moving_content: # Temporary code
if event.scancode == 16777221: # Enter if event.scancode == 16777221: # Enter
move_content_confirm() transform_content_confirm()
elif event.scancode == 16777217: # Escape elif event.scancode == 16777217: # Escape
move_content_cancel() transform_content_cancel()
elif event is InputEventMouse: elif event is InputEventMouse:
var gizmo : Gizmo var gizmo : Gizmo
if big_bounding_rectangle.size != Vector2.ZERO: if big_bounding_rectangle.size != Vector2.ZERO:
@ -104,7 +104,7 @@ func _input(event : InputEvent) -> void:
if !is_moving_content: if !is_moving_content:
temp_rect = big_bounding_rectangle temp_rect = big_bounding_rectangle
temp_bitmap = Global.current_project.selection_bitmap temp_bitmap = Global.current_project.selection_bitmap
move_content_start() transform_content_start()
Global.current_project.selection_offset = Vector2.ZERO Global.current_project.selection_offset = Vector2.ZERO
if gizmo.type == Gizmo.Type.ROTATE: if gizmo.type == Gizmo.Type.ROTATE:
var img_size := max(original_preview_image.get_width(), original_preview_image.get_height()) var img_size := max(original_preview_image.get_width(), original_preview_image.get_height())
@ -310,7 +310,7 @@ func move_borders_end() -> void:
update() update()
func move_content_start() -> void: func transform_content_start() -> void:
if !is_moving_content: if !is_moving_content:
is_moving_content = true is_moving_content = true
undo_data = _get_undo_data(true) undo_data = _get_undo_data(true)
@ -325,7 +325,7 @@ func move_content(move : Vector2) -> void:
move_borders(move) move_borders(move)
func move_content_confirm() -> void: func transform_content_confirm() -> void:
if !is_moving_content: if !is_moving_content:
return return
var project : Project = Global.current_project var project : Project = Global.current_project
@ -344,7 +344,7 @@ func move_content_confirm() -> void:
update() update()
func move_content_cancel() -> void: func transform_content_cancel() -> void:
if preview_image.is_empty(): if preview_image.is_empty():
return return
var project : Project = Global.current_project var project : Project = Global.current_project
@ -505,7 +505,7 @@ func select_all() -> void:
func invert() -> void: func invert() -> void:
move_content_confirm() transform_content_confirm()
var project := Global.current_project var project := Global.current_project
var _undo_data = _get_undo_data(false) var _undo_data = _get_undo_data(false)
var selection_bitmap_copy : BitMap = project.selection_bitmap.duplicate() 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 var project := Global.current_project
if !project.has_selection: if !project.has_selection:
return return
move_content_confirm() transform_content_confirm()
var _undo_data = _get_undo_data(false) var _undo_data = _get_undo_data(false)
var selection_bitmap_copy : BitMap = project.selection_bitmap.duplicate() var selection_bitmap_copy : BitMap = project.selection_bitmap.duplicate()
selection_bitmap_copy = project.resize_bitmap(selection_bitmap_copy, project.size) selection_bitmap_copy = project.resize_bitmap(selection_bitmap_copy, project.size)

View file

@ -222,7 +222,7 @@ func set_export_progress_bar(value: float) -> void:
func _on_ExportDialog_about_to_show() -> 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 we're on HTML5, don't let the user change the directory path
if OS.get_name() == "HTML5": if OS.get_name() == "HTML5":
path_container.visible = false path_container.visible = false

View file

@ -16,7 +16,7 @@ onready var preview_rect : TextureRect = $VBoxContainer/Preview
func _on_ResizeCanvas_about_to_show() -> void: func _on_ResizeCanvas_about_to_show() -> void:
Global.canvas.selection.move_content_confirm() Global.canvas.selection.transform_content_confirm()
image = Image.new() image = Image.new()
image.create(Global.current_project.size.x, Global.current_project.size.y, false, Image.FORMAT_RGBA8) image.create(Global.current_project.size.x, Global.current_project.size.y, false, Image.FORMAT_RGBA8)
image.lock() image.lock()

View file

@ -12,7 +12,7 @@ onready var ratio_box : BaseButton = find_node("AspectRatioButton")
func _on_ScaleImage_about_to_show() -> void: 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 width_value.value = Global.current_project.size.x
height_value.value = Global.current_project.size.y height_value.value = Global.current_project.size.y
width_value_perc.value = 100 width_value_perc.value = 100