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
preferencesAboutTextFull
letsfindaway 3 years ago
parent 7e83f910ca
commit 136297d695
  1. 18
      src/domain/UBGraphicsScene.cpp

@ -840,6 +840,8 @@ void UBGraphicsScene::drawMarkerCircle(const QPointF &pPoint)
void UBGraphicsScene::drawPenCircle(const QPointF &pPoint) void UBGraphicsScene::drawPenCircle(const QPointF &pPoint)
{ {
QCursor cursor;
if (mPenCircle && UBSettings::settings()->showPenPreviewCircle->get().toBool() && if (mPenCircle && UBSettings::settings()->showPenPreviewCircle->get().toBool() &&
UBSettings::settings()->currentPenWidth() >= UBSettings::settings()->penPreviewFromSize->get().toInt()) { UBSettings::settings()->currentPenWidth() >= UBSettings::settings()->penPreviewFromSize->get().toInt()) {
qreal penDiameter = UBSettings::settings()->currentPenWidth(); qreal penDiameter = UBSettings::settings()->currentPenWidth();
@ -849,20 +851,20 @@ void UBGraphicsScene::drawPenCircle(const QPointF &pPoint)
mPenCircle->setRect(QRectF(pPoint.x() - penRadius, pPoint.y() - penRadius, mPenCircle->setRect(QRectF(pPoint.x() - penRadius, pPoint.y() - penRadius,
penDiameter, penDiameter)); penDiameter, penDiameter));
if (controlView())
if (controlView()->viewport())
controlView()->viewport()->setCursor(QCursor (Qt::BlankCursor));
mPenCircle->show(); mPenCircle->show();
cursor = Qt::BlankCursor;
} }
else else
{ {
if (controlView()) cursor = UBResources::resources()->penCursor;
if (controlView()->viewport())
controlView()->viewport()->setCursor(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() void UBGraphicsScene::hideMarkerCircle()

Loading…
Cancel
Save