[graphics/krita] libs/ui: Extend range to 10x, more sensible default 5x. Some minor refractor

Emmet O'Neill <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 05f90bc056a71152a4886fff4435cdeb1c3e99e6 by Emmet O'Neill, on behalf of Le Tien Dat.
Committed on 13/08/2026 at 23:16.
Pushed by emmetoneill into branch 'master'.

Extend range to 10x, more sensible default 5x. Some minor refractor

M  +1    -1    libs/ui/dialogs/kis_dlg_preferences.cc
M  +1    -1    libs/ui/kis_config.cc
M  +4    -4    libs/ui/tool/KisAsyncColorSamplerHelper.cpp

https://invent.kde.org/graphics/krita/-/commit/05f90bc056a71152a4886fff4435cdeb1c3e99e6

diff --git a/libs/ui/dialogs/kis_dlg_preferences.cc b/libs/ui/dialogs/kis_dlg_preferences.cc
index fb5aefd2e1a..c6520043bbd 100644
--- a/libs/ui/dialogs/kis_dlg_preferences.cc
+++ b/libs/ui/dialogs/kis_dlg_preferences.cc
@@ -329,7 +329,7 @@ GeneralTab::GeneralTab(QWidget *_parent, const char *_name)
 
     m_chkColorSamplerPreviewExtraCircles->setChecked(cfg.colorSamplerPreviewCircleExtraCirclesEnabled());
 
-    m_ssbColorSamplerZoomPreviewScale->setRange(100, 500);
+    m_ssbColorSamplerZoomPreviewScale->setRange(100, 1000);
     m_ssbColorSamplerZoomPreviewScale->setSingleStep(25);
     m_ssbColorSamplerZoomPreviewScale->setValue(cfg.colorSamplerZoomPreviewScale());
 
diff --git a/libs/ui/kis_config.cc b/libs/ui/kis_config.cc
index 155aa177014..6afecc2f9e6 100644
--- a/libs/ui/kis_config.cc
+++ b/libs/ui/kis_config.cc
@@ -571,7 +571,7 @@ void KisConfig::setColorSamplerPreviewCircleThickness(qreal thickness)
 
 
 qreal KisConfig::colorSamplerZoomPreviewScale(bool defaultValue) const {
-    qreal def = 200;
+    qreal def = 500;
     if (!defaultValue) {
         return m_cfg.readEntry("colorSamplerZoomPreviewScale", def);
     }
diff --git a/libs/ui/tool/KisAsyncColorSamplerHelper.cpp b/libs/ui/tool/KisAsyncColorSamplerHelper.cpp
index 00348eb856d..b0e8d6acc24 100644
--- a/libs/ui/tool/KisAsyncColorSamplerHelper.cpp
+++ b/libs/ui/tool/KisAsyncColorSamplerHelper.cpp
@@ -625,6 +625,8 @@ void KisAsyncColorSamplerHelper::paintCircleReferenceImagePreview(QPainter &gc,
         QPolygonF outline = refImage->absoluteTransformation().map(refImage->outlineRect());
         if (!outline.intersects(QPolygonF(sampleDocRectF))) continue;
 
+        gc.save();
+
         QImage image = refImage->getCachedImage();
         // image.convertTo(QImage::Format_ARGB32); Do this in KisReferenceImage to avoid having to copy? and convert
 
@@ -642,11 +644,9 @@ void KisAsyncColorSamplerHelper::paintCircleReferenceImagePreview(QPainter &gc,
         gc.rotate(refImage->rotation());
         gc.translate(-viewRectF.center());
 
-        gc.drawImage(viewRectF, image.copy(sampleRefRectF.toRect()));
+        gc.drawImage(viewRectF, image, sampleRefRectF.toRect());
 
-        gc.translate(viewRectF.center());
-        gc.rotate(-refImage->rotation());
-        gc.translate(-viewRectF.center());
+        gc.restore();
     }
 
     gc.restore();
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.