[graphics/krita] libs/ui/tool: Don't fetch if position still same

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

Don't fetch if position still same

M  +2    -2    libs/ui/tool/KisAsyncColorSamplerHelper.cpp
M  +1    -1    libs/ui/tool/strokes/kis_color_sampler_stroke_strategy.cpp

https://invent.kde.org/graphics/krita/-/commit/6ef7f97026aaa6cd7e783660e9d285302ac404e9

diff --git a/libs/ui/tool/KisAsyncColorSamplerHelper.cpp b/libs/ui/tool/KisAsyncColorSamplerHelper.cpp
index 4ad99c522a6..a70fc642215 100644
--- a/libs/ui/tool/KisAsyncColorSamplerHelper.cpp
+++ b/libs/ui/tool/KisAsyncColorSamplerHelper.cpp
@@ -731,14 +731,14 @@ QImage KisAsyncColorSamplerHelper::fetchCanvasPreview(QRect &canvasPixelRect) {
     }
 
     // If not already have a job fetching canvas image, then do it
-    if (!m_d->canvasPreviewFetchingStarted) {
+    if (!m_d->canvasPreviewFetchingStarted && m_d->cacheCanvasPreviewRect != canvasPixelRect) {
         m_d->canvasPreviewFetchingStarted = true;
         m_d->strokesFacade()->addJob(m_d->strokeId,
             new KisColorSamplerStrokeStrategy::GenerateCanvasZoomPreviewData(m_d->canvas, canvasPixelRect));
     }
 
     // Render the last frame if available
-    if (!m_d->cacheCanvasPreviewRect.isNull()) canvasPixelRect = m_d->cacheCanvasPreviewRect;
+    if (!m_d->cacheCanvasPreviewRect.isNull()) canvasPixelRect = QRect(QPoint(0,0), m_d->cacheCanvasPreviewRect.size());
 
     return m_d->cacheCanvasPreviewImage;
 }
diff --git a/libs/ui/tool/strokes/kis_color_sampler_stroke_strategy.cpp b/libs/ui/tool/strokes/kis_color_sampler_stroke_strategy.cpp
index dbf9aec6fb6..13a43057c3a 100644
--- a/libs/ui/tool/strokes/kis_color_sampler_stroke_strategy.cpp
+++ b/libs/ui/tool/strokes/kis_color_sampler_stroke_strategy.cpp
@@ -65,7 +65,7 @@ void KisColorSamplerStrokeStrategy::doStrokeCallback(KisStrokeJobData *data)
 
         QImage image = previewData->canvas->displayColorConverter()->convertImageToDisplayColorSpace(tmpDev, previewData->canvasPixelRect, true);
 
-        Q_EMIT sigCanvasZoomPreviewUpdated(image, QRect(QPoint(0,0), previewData->canvasPixelRect.size()));
+        Q_EMIT sigCanvasZoomPreviewUpdated(image, previewData->canvasPixelRect);
     }
 }
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.