fix: ruler stays effective after deleted from board

- set active ruler only with drawing tool
- avoid setting the active ruler when entering the ruler to close it
more-line-styles
letsfindaway 2 years ago
parent e7907cd38f
commit f1ea20c9dc
  1. 4
      src/tools/UBGraphicsRuler.cpp

@ -420,9 +420,6 @@ void UBGraphicsRuler::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
{ {
UBStylusTool::Enum currentTool = (UBStylusTool::Enum)UBDrawingController::drawingController ()->stylusTool (); UBStylusTool::Enum currentTool = (UBStylusTool::Enum)UBDrawingController::drawingController ()->stylusTool ();
if (UBDrawingController::drawingController()->mActiveRuler == nullptr)
UBDrawingController::drawingController()->mActiveRuler = this;
if (currentTool == UBStylusTool::Selector || if (currentTool == UBStylusTool::Selector ||
currentTool == UBStylusTool::Play) currentTool == UBStylusTool::Play)
{ {
@ -453,6 +450,7 @@ void UBGraphicsRuler::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
else if (UBDrawingController::drawingController()->isDrawingTool()) else if (UBDrawingController::drawingController()->isDrawingTool())
{ {
setCursor(drawRulerLineCursor()); setCursor(drawRulerLineCursor());
UBDrawingController::drawingController()->mActiveRuler = this;
event->accept(); event->accept();
} }
} }

Loading…
Cancel
Save