mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-07 10:59:49 +00:00
Fix crash when deleting a frame or layer and there is a transformation occurring
This commit is contained in:
parent
24da4bd703
commit
c859834f7c
|
@ -220,6 +220,8 @@ func handle_redo(_action : String, project : Project = Global.current_project, l
|
||||||
func update_texture(layer_index : int, frame_index := -1, project : Project = Global.current_project) -> void:
|
func update_texture(layer_index : int, frame_index := -1, project : Project = Global.current_project) -> void:
|
||||||
if frame_index == -1:
|
if frame_index == -1:
|
||||||
frame_index = project.current_frame
|
frame_index = project.current_frame
|
||||||
|
|
||||||
|
if frame_index < project.frames.size() and layer_index < project.layers.size():
|
||||||
var current_cel : Cel = project.frames[frame_index].cels[layer_index]
|
var current_cel : Cel = project.frames[frame_index].cels[layer_index]
|
||||||
current_cel.image_texture.create_from_image(current_cel.image, 0)
|
current_cel.image_texture.create_from_image(current_cel.image, 0)
|
||||||
|
|
||||||
|
|
|
@ -442,18 +442,19 @@ 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
|
||||||
|
if project.current_frame < project.frames.size() and project.current_layer < project.layers.size():
|
||||||
var cel_image : Image = project.frames[project.current_frame].cels[project.current_layer].image
|
var cel_image : Image = project.frames[project.current_frame].cels[project.current_layer].image
|
||||||
cel_image.blit_rect_mask(preview_image, preview_image, Rect2(Vector2.ZERO, project.selection_bitmap.get_size()), big_bounding_rectangle.position)
|
cel_image.blit_rect_mask(preview_image, preview_image, 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
|
||||||
|
commit_undo("Move Selection", undo_data)
|
||||||
|
|
||||||
original_preview_image = Image.new()
|
original_preview_image = Image.new()
|
||||||
preview_image = Image.new()
|
preview_image = Image.new()
|
||||||
original_bitmap = BitMap.new()
|
original_bitmap = BitMap.new()
|
||||||
is_moving_content = false
|
is_moving_content = false
|
||||||
is_pasting = false
|
is_pasting = false
|
||||||
commit_undo("Move Selection", undo_data)
|
|
||||||
update()
|
update()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue