[graphics/krita/krita/5.2] libs/ui/imagesize: Reset the canvas size on toggling preserve aspect ratio

Halla Rempt null at kde.org
Fri May 30 11:02:54 BST 2025


Git commit 988b4af005a739966347921a72aeaaea26d0c856 by Halla Rempt.
Committed on 30/05/2025 at 10:02.
Pushed by rempt into branch 'krita/5.2'.

Reset the canvas size on toggling preserve aspect ratio

The original intent of Juan Palacios' patch committed twelve
years ago was to reset the dialog to the original values:

https://invent.kde.org/graphics/krita/-/commit/b005c7e0dc569f58308b08238b0b3c67101783f0

It is debatable whether we should do that and not keep the
values the user entered, but that needs more discussion.

CCMAIL:kimageshop at kde.org

BUG:452605
(cherry picked from commit 20d6643a0c950830de98266c7a8166d59a0d49b8)

M  +3    -2    libs/ui/imagesize/dlg_canvassize.cc

https://invent.kde.org/graphics/krita/-/commit/988b4af005a739966347921a72aeaaea26d0c856

diff --git a/libs/ui/imagesize/dlg_canvassize.cc b/libs/ui/imagesize/dlg_canvassize.cc
index 91dcdf9e15b..5bf4f829f50 100644
--- a/libs/ui/imagesize/dlg_canvassize.cc
+++ b/libs/ui/imagesize/dlg_canvassize.cc
@@ -243,17 +243,18 @@ void DlgCanvasSize::slotAspectChanged(bool keep)
 
     if (keep) {
         // size values may be out of sync, so we need to reset it to defaults
-        m_newWidth = m_originalWidth;
-        m_newHeight = m_originalHeight;
         m_xOffset = 0;
         m_yOffset = 0;
 
         m_page->canvasPreview->blockSignals(true);
         m_page->canvasPreview->setCanvasSize(m_newWidth, m_newHeight);
+        m_page->newWidthDouble->setValue(m_newWidth);
+        m_page->newHeightDouble->setValue(m_newHeight);
         m_page->canvasPreview->setImageOffset(m_xOffset, m_yOffset);
         m_page->canvasPreview->blockSignals(false);
         updateOffset(CENTER);
         updateButtons(CENTER);
+
     }
 }
 


More information about the kimageshop mailing list