fixed a bug where clicking on/moving a textbox by its rubberband whith stylus tool on text caused a crash (more frequent after zoom out)

preferencesAboutTextFull
Clément Fauconnier 7 years ago
parent 3822e1f360
commit ae559ac3d4
  1. 8
      src/board/UBBoardView.cpp

@ -1310,10 +1310,6 @@ void UBBoardView::mouseReleaseEvent (QMouseEvent *event)
} }
else if (currentTool == UBStylusTool::Text) else if (currentTool == UBStylusTool::Text)
{ {
UBGraphicsItem *graphicsItem = dynamic_cast<UBGraphicsItem*>(movingItem);
if (graphicsItem)
graphicsItem->Delegate()->commitUndoStep();
bool bReleaseIsNeed = true; bool bReleaseIsNeed = true;
if (movingItem != determineItemToPress(scene()->itemAt(this->mapToScene(event->localPos().toPoint()), QTransform()))) if (movingItem != determineItemToPress(scene()->itemAt(this->mapToScene(event->localPos().toPoint()), QTransform())))
{ {
@ -1321,6 +1317,10 @@ void UBBoardView::mouseReleaseEvent (QMouseEvent *event)
bReleaseIsNeed = false; bReleaseIsNeed = false;
} }
UBGraphicsItem *graphicsItem = dynamic_cast<UBGraphicsItem*>(movingItem);
if (graphicsItem)
graphicsItem->Delegate()->commitUndoStep();
if (mWidgetMoved) if (mWidgetMoved)
{ {
mWidgetMoved = false; mWidgetMoved = false;

Loading…
Cancel
Save