diff --git a/src/desktop/scene/canvasview.cpp b/src/desktop/scene/canvasview.cpp index 0e464bb4e3..75a724238f 100644 --- a/src/desktop/scene/canvasview.cpp +++ b/src/desktop/scene/canvasview.cpp @@ -2076,12 +2076,17 @@ void CanvasView::moveDrag(const QPoint &point) m_dragLastPoint = point; } +bool CanvasView::setSceneColorPick( + int source, const QPointF &posf, const QColor &color) +{ + return m_scene->setColorPick(source, mapToScene(posf.toPoint()), color); +} + void CanvasView::pickColor( int source, const QPointF &point, const QPointF &posf) { QColor color = m_scene->model()->pickColor(point.x(), point.y(), 0, 0); - m_pickingColor = - m_scene->setColorPick(source, mapToScene(posf.toPoint()), color); + m_pickingColor = setSceneColorPick(source, posf, color); } void CanvasView::touchColorPick(const QPointF &posf) diff --git a/src/desktop/scene/canvasview.h b/src/desktop/scene/canvasview.h index ec8f304171..ccb4259fab 100644 --- a/src/desktop/scene/canvasview.h +++ b/src/desktop/scene/canvasview.h @@ -188,6 +188,9 @@ public slots: void setViewFlip(bool flip); void setViewMirror(bool mirror); + bool + setSceneColorPick(int source, const QPointF &posf, const QColor &color); + void setLockReasons(QFlags reasons); void setLockDescription(const QString &lockDescription); void setToolState(int toolState); diff --git a/src/desktop/scene/scenewrapper.cpp b/src/desktop/scene/scenewrapper.cpp index bddc2859c0..38b84ff5c2 100644 --- a/src/desktop/scene/scenewrapper.cpp +++ b/src/desktop/scene/scenewrapper.cpp @@ -312,8 +312,8 @@ void SceneWrapper::connectDocument(Document *doc) toolCtrl, &tools::ToolController::colorUsed, m_scene, &CanvasScene::setComparisonColor); connect( - toolCtrl, &tools::ToolController::colorPickRequested, m_scene, - &CanvasScene::setColorPick); + toolCtrl, &tools::ToolController::colorPickRequested, m_view, + &CanvasView::setSceneColorPick); connect( toolCtrl, &tools::ToolController::maskPreviewRequested, m_scene, &CanvasScene::setMaskPreview);