mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-31 07:29:49 +00:00
Delete content in all selected cels, and not when a layer is locked/invisible
This commit is contained in:
parent
da65380169
commit
f327eccaa1
|
@ -653,7 +653,7 @@ func cut() -> void:
|
||||||
if !project.layers[project.current_layer].can_layer_get_drawn():
|
if !project.layers[project.current_layer].can_layer_get_drawn():
|
||||||
return
|
return
|
||||||
copy()
|
copy()
|
||||||
delete()
|
delete(false)
|
||||||
|
|
||||||
|
|
||||||
func copy() -> void:
|
func copy() -> void:
|
||||||
|
@ -728,10 +728,12 @@ func paste() -> void:
|
||||||
project.selection_bitmap_changed()
|
project.selection_bitmap_changed()
|
||||||
|
|
||||||
|
|
||||||
func delete() -> void:
|
func delete(selected_cels := true) -> void:
|
||||||
var project: Project = Global.current_project
|
var project: Project = Global.current_project
|
||||||
if !project.has_selection:
|
if !project.has_selection:
|
||||||
return
|
return
|
||||||
|
if !project.layers[project.current_layer].can_layer_get_drawn():
|
||||||
|
return
|
||||||
if is_moving_content:
|
if is_moving_content:
|
||||||
is_moving_content = false
|
is_moving_content = false
|
||||||
original_preview_image = Image.new()
|
original_preview_image = Image.new()
|
||||||
|
@ -743,12 +745,18 @@ func delete() -> void:
|
||||||
return
|
return
|
||||||
|
|
||||||
var undo_data_tmp := get_undo_data(true)
|
var undo_data_tmp := get_undo_data(true)
|
||||||
var image: Image = project.frames[project.current_frame].cels[project.current_layer].image
|
var images: Array
|
||||||
|
if selected_cels:
|
||||||
|
images = _get_selected_draw_images()
|
||||||
|
else:
|
||||||
|
images = [project.frames[project.current_frame].cels[project.current_layer].image]
|
||||||
|
|
||||||
for x in big_bounding_rectangle.size.x:
|
for x in big_bounding_rectangle.size.x:
|
||||||
for y in big_bounding_rectangle.size.y:
|
for y in big_bounding_rectangle.size.y:
|
||||||
var pos := Vector2(x, y) + big_bounding_rectangle.position
|
var pos := Vector2(x, y) + big_bounding_rectangle.position
|
||||||
if project.can_pixel_get_drawn(pos):
|
if project.can_pixel_get_drawn(pos):
|
||||||
image.set_pixelv(pos, Color(0))
|
for image in images:
|
||||||
|
image.set_pixelv(pos, Color(0))
|
||||||
commit_undo("Draw", undo_data_tmp)
|
commit_undo("Draw", undo_data_tmp)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue