Commit ae559ac3 authored by Clément Fauconnier's avatar Clément Fauconnier

fixed a bug where clicking on/moving a textbox by its rubberband whith stylus...

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)
parent 3822e1f3
...@@ -1310,10 +1310,6 @@ void UBBoardView::mouseReleaseEvent (QMouseEvent *event) ...@@ -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) ...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment