From 136297d695db35767ef8b6650c38a0e6e37acc30 Mon Sep 17 00:00:00 2001 From: letsfindaway Date: Sat, 4 Dec 2021 18:08:56 +0100 Subject: [PATCH] fix: cursow shown on a ruler using pen tool - when using the pen tool on a ruler the "normal" cursor was shown - instead the special drawRulerLine cursor should be shown - UBGraphicsScene::drawPenCircle update cursor only with no active ruler --- src/domain/UBGraphicsScene.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index 0336a63c..20103686 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -840,6 +840,8 @@ void UBGraphicsScene::drawMarkerCircle(const QPointF &pPoint) void UBGraphicsScene::drawPenCircle(const QPointF &pPoint) { + QCursor cursor; + if (mPenCircle && UBSettings::settings()->showPenPreviewCircle->get().toBool() && UBSettings::settings()->currentPenWidth() >= UBSettings::settings()->penPreviewFromSize->get().toInt()) { qreal penDiameter = UBSettings::settings()->currentPenWidth(); @@ -849,20 +851,20 @@ void UBGraphicsScene::drawPenCircle(const QPointF &pPoint) mPenCircle->setRect(QRectF(pPoint.x() - penRadius, pPoint.y() - penRadius, penDiameter, penDiameter)); - - if (controlView()) - if (controlView()->viewport()) - controlView()->viewport()->setCursor(QCursor (Qt::BlankCursor)); - mPenCircle->show(); + cursor = Qt::BlankCursor; } else { - if (controlView()) - if (controlView()->viewport()) - controlView()->viewport()->setCursor(UBResources::resources()->penCursor); + cursor = UBResources::resources()->penCursor; } + if (!UBDrawingController::drawingController()->mActiveRuler) + { + // set cursor only if no active ruler + if (controlView() && controlView()->viewport()) + controlView()->viewport()->setCursor(cursor); + } } void UBGraphicsScene::hideMarkerCircle()