From ae559ac3d494f7968301caf1350b0b139b7846c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fauconnier?= Date: Fri, 3 Nov 2017 12:15:49 +0100 Subject: [PATCH] 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) --- src/board/UBBoardView.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/board/UBBoardView.cpp b/src/board/UBBoardView.cpp index 97e8233c..6bf80853 100644 --- a/src/board/UBBoardView.cpp +++ b/src/board/UBBoardView.cpp @@ -1310,10 +1310,6 @@ void UBBoardView::mouseReleaseEvent (QMouseEvent *event) } else if (currentTool == UBStylusTool::Text) { - UBGraphicsItem *graphicsItem = dynamic_cast(movingItem); - if (graphicsItem) - graphicsItem->Delegate()->commitUndoStep(); - bool bReleaseIsNeed = true; if (movingItem != determineItemToPress(scene()->itemAt(this->mapToScene(event->localPos().toPoint()), QTransform()))) { @@ -1321,6 +1317,10 @@ void UBBoardView::mouseReleaseEvent (QMouseEvent *event) bReleaseIsNeed = false; } + UBGraphicsItem *graphicsItem = dynamic_cast(movingItem); + if (graphicsItem) + graphicsItem->Delegate()->commitUndoStep(); + if (mWidgetMoved) { mWidgetMoved = false;