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

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


Git commit 20d6643a0c950830de98266c7a8166d59a0d49b8 by Halla Rempt.
Committed on 30/05/2025 at 09:59.
Pushed by rempt into branch 'master'.

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

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

https://invent.kde.org/graphics/krita/-/commit/20d6643a0c950830de98266c7a8166d59a0d49b8

diff --git a/libs/ui/imagesize/dlg_canvassize.cc b/libs/ui/imagesize/dlg_canvassize.cc
index af497166354..1bcd76801a3 100644
--- a/libs/ui/imagesize/dlg_canvassize.cc
+++ b/libs/ui/imagesize/dlg_canvassize.cc
@@ -242,17 +242,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