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

Fix issue where resizing pasted content resulted in errors

This commit is contained in:
Emmanouil Papadeas 2023-05-12 13:24:49 +03:00
parent 23720afd05
commit 362f4109d4

View file

@ -750,10 +750,6 @@ func paste(in_place := false) -> void:
undo_data = get_undo_data(true) undo_data = get_undo_data(true)
var project: Project = Global.current_project var project: Project = Global.current_project
original_bitmap.copy_from(project.selection_map)
original_big_bounding_rectangle = big_bounding_rectangle
original_offset = project.selection_offset
var clip_map := SelectionMap.new() var clip_map := SelectionMap.new()
clip_map.data = clipboard.selection_map clip_map.data = clipboard.selection_map
var max_size := Vector2( var max_size := Vector2(
@ -785,6 +781,9 @@ func paste(in_place := false) -> void:
is_moving_content = true is_moving_content = true
is_pasting = true is_pasting = true
original_preview_image = clipboard.image original_preview_image = clipboard.image
original_big_bounding_rectangle = big_bounding_rectangle
original_offset = project.selection_offset
original_bitmap.copy_from(project.selection_map)
preview_image.copy_from(original_preview_image) preview_image.copy_from(original_preview_image)
preview_image_texture.create_from_image(preview_image, 0) preview_image_texture.create_from_image(preview_image, 0)
project.selection_map_changed() project.selection_map_changed()