mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-19 01:29:49 +00:00
Selection fixes (#527)
* Fix for multiple cel selection issue Now it will only apply selection to the selected cels that are **visible and unlocked** * Fix for loss of selection data This will hopefully fix the selection data loss on toggling layer buttons
This commit is contained in:
parent
c29254c2e8
commit
75059b5b12
|
@ -472,17 +472,18 @@ func transform_content_confirm() -> void:
|
||||||
var frame : int = cel_index[0]
|
var frame : int = cel_index[0]
|
||||||
var layer : int = cel_index[1]
|
var layer : int = cel_index[1]
|
||||||
if frame < project.frames.size() and layer < project.layers.size():
|
if frame < project.frames.size() and layer < project.layers.size():
|
||||||
var cel_image : Image = project.frames[frame].cels[layer].image
|
if Global.current_project.layers[layer].can_layer_get_drawn():
|
||||||
var src : Image = preview_image
|
var cel_image : Image = project.frames[frame].cels[layer].image
|
||||||
if not is_pasting and not (frame == project.current_frame and layer == project.current_layer):
|
var src : Image = preview_image
|
||||||
src = get_selected_image(cel_image, clear_in_selected_cels)
|
if not is_pasting and not (frame == project.current_frame and layer == project.current_layer):
|
||||||
src.resize(big_bounding_rectangle.size.x, big_bounding_rectangle.size.y, Image.INTERPOLATE_NEAREST)
|
src = get_selected_image(cel_image, clear_in_selected_cels)
|
||||||
if temp_rect.size.x < 0:
|
src.resize(big_bounding_rectangle.size.x, big_bounding_rectangle.size.y, Image.INTERPOLATE_NEAREST)
|
||||||
src.flip_x()
|
if temp_rect.size.x < 0:
|
||||||
if temp_rect.size.y < 0:
|
src.flip_x()
|
||||||
src.flip_y()
|
if temp_rect.size.y < 0:
|
||||||
|
src.flip_y()
|
||||||
|
|
||||||
cel_image.blit_rect_mask(src, src, Rect2(Vector2.ZERO, project.selection_bitmap.get_size()), big_bounding_rectangle.position)
|
cel_image.blit_rect_mask(src, src, Rect2(Vector2.ZERO, project.selection_bitmap.get_size()), big_bounding_rectangle.position)
|
||||||
var selected_bitmap_copy = project.selection_bitmap.duplicate()
|
var selected_bitmap_copy = project.selection_bitmap.duplicate()
|
||||||
project.move_bitmap_values(selected_bitmap_copy)
|
project.move_bitmap_values(selected_bitmap_copy)
|
||||||
project.selection_bitmap = selected_bitmap_copy
|
project.selection_bitmap = selected_bitmap_copy
|
||||||
|
|
|
@ -94,15 +94,18 @@ func save_layer_name(new_name : String) -> void:
|
||||||
|
|
||||||
|
|
||||||
func _on_VisibilityButton_pressed() -> void:
|
func _on_VisibilityButton_pressed() -> void:
|
||||||
|
Global.canvas.selection.transform_content_confirm()
|
||||||
Global.current_project.layers[layer].visible = !Global.current_project.layers[layer].visible
|
Global.current_project.layers[layer].visible = !Global.current_project.layers[layer].visible
|
||||||
Global.canvas.update()
|
Global.canvas.update()
|
||||||
|
|
||||||
|
|
||||||
func _on_LockButton_pressed() -> void:
|
func _on_LockButton_pressed() -> void:
|
||||||
|
Global.canvas.selection.transform_content_confirm()
|
||||||
Global.current_project.layers[layer].locked = !Global.current_project.layers[layer].locked
|
Global.current_project.layers[layer].locked = !Global.current_project.layers[layer].locked
|
||||||
|
|
||||||
|
|
||||||
func _on_LinkButton_pressed() -> void:
|
func _on_LinkButton_pressed() -> void:
|
||||||
|
Global.canvas.selection.transform_content_confirm()
|
||||||
Global.current_project.layers[layer].new_cels_linked = !Global.current_project.layers[layer].new_cels_linked
|
Global.current_project.layers[layer].new_cels_linked = !Global.current_project.layers[layer].new_cels_linked
|
||||||
if Global.current_project.layers[layer].new_cels_linked && !Global.current_project.layers[layer].linked_cels:
|
if Global.current_project.layers[layer].new_cels_linked && !Global.current_project.layers[layer].linked_cels:
|
||||||
# If button is pressed and there are no linked cels in the layer
|
# If button is pressed and there are no linked cels in the layer
|
||||||
|
|
Loading…
Reference in a new issue