From b8c2cd52b5e968a12e0c1373002de03e07b56e6e Mon Sep 17 00:00:00 2001 From: Dale Cieslak Date: Sat, 28 Oct 2023 07:58:32 -0700 Subject: [PATCH] ScaleManipulator: return *copy* of preview bitmap if dimensions don't change. --- artpaint/viewmanipulators/ScaleManipulator.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/artpaint/viewmanipulators/ScaleManipulator.cpp b/artpaint/viewmanipulators/ScaleManipulator.cpp index e829a589..72da926b 100644 --- a/artpaint/viewmanipulators/ScaleManipulator.cpp +++ b/artpaint/viewmanipulators/ScaleManipulator.cpp @@ -170,8 +170,12 @@ ScaleManipulator::ManipulateBitmap( && new_settings->left == original_left && new_settings->top == original_top) return NULL; - if (new_width == starting_width && new_height == starting_height) - return preview_bitmap; + if (new_width == starting_width && new_height == starting_height) { + if (final_bitmap != NULL) + delete final_bitmap; + final_bitmap = new BBitmap(preview_bitmap, B_RGBA32); + return final_bitmap; + } BMessage progress_message = BMessage(B_UPDATE_STATUS_BAR); progress_message.AddFloat("delta", 0.0);