From b7e598c438801a8c1ccef3b22ec9068deb5f7b2f Mon Sep 17 00:00:00 2001 From: Manolis Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Wed, 6 Oct 2021 02:02:56 +0300 Subject: [PATCH] Fix issue with copying and pasting to a different project that has a smaller canvas Fixes a bug caused by 86e66495b1d4e7677332f63502383e2d6199dcec --- src/UI/Canvas/Selection.gd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/UI/Canvas/Selection.gd b/src/UI/Canvas/Selection.gd index 476c555f1..6d290ad4c 100644 --- a/src/UI/Canvas/Selection.gd +++ b/src/UI/Canvas/Selection.gd @@ -633,8 +633,9 @@ func paste() -> void: original_offset = project.selection_offset var clip_bitmap : BitMap = clipboard.selection_bitmap.duplicate() + var max_size := Vector2(max(clip_bitmap.get_size().x, project.selection_bitmap.get_size().x), max(clip_bitmap.get_size().y, project.selection_bitmap.get_size().y)) - project.selection_bitmap = Global.current_project.resize_bitmap(clip_bitmap, project.selection_bitmap.get_size()) + project.selection_bitmap = Global.current_project.resize_bitmap(clip_bitmap, max_size) self.big_bounding_rectangle = clipboard.big_bounding_rectangle project.selection_offset = clipboard.selection_offset