1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-02-21 13:03:13 +00:00

Fix Copy & Delete to work on the currently selected parts of the image

This also fixed a crash when deleting while content is being moved/resized
This commit is contained in:
Manolis Papadeas 2021-04-19 19:05:05 +03:00
parent fccd37360a
commit 1d5b44fad2

View file

@ -379,9 +379,12 @@ func copy() -> void:
return
var image : Image = project.frames[project.current_frame].cels[project.current_layer].image
var to_copy := Image.new()
if is_moving_content:
to_copy.copy_from(preview_image)
else:
to_copy = image.get_rect(big_bounding_rectangle)
to_copy.lock()
# Only remove unincluded pixels if the selection is not a single rectangle
# Remove unincluded pixels if the selection is not a single rectangle
for x in to_copy.get_size().x:
for y in to_copy.get_size().y:
var pos := Vector2(x, y)
@ -427,6 +430,16 @@ func delete() -> void:
var project := Global.current_project
if !project.has_selection:
return
if is_moving_content:
is_moving_content = false
original_preview_image = Image.new()
preview_image = Image.new()
original_bitmap = BitMap.new()
is_pasting = false
update()
commit_undo("Draw", undo_data)
return
var _undo_data = _get_undo_data(true)
var image : Image = project.frames[project.current_frame].cels[project.current_layer].image
for x in big_bounding_rectangle.size.x: