|
|
@ -141,8 +141,11 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent) |
|
|
|
|
|
|
|
|
|
|
|
UBGraphicsScene::~UBGraphicsScene() |
|
|
|
UBGraphicsScene::~UBGraphicsScene() |
|
|
|
{ |
|
|
|
{ |
|
|
|
// NOOP
|
|
|
|
|
|
|
|
DisposeMagnifierQWidgets(); |
|
|
|
DisposeMagnifierQWidgets(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mCurrentStroke) |
|
|
|
|
|
|
|
if (mCurrentStroke->polygons().empty()) |
|
|
|
|
|
|
|
delete mCurrentStroke; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UBGraphicsScene::selectionChangedProcessing() |
|
|
|
void UBGraphicsScene::selectionChangedProcessing() |
|
|
@ -190,6 +193,12 @@ bool UBGraphicsScene::inputDevicePress(const QPointF& scenePos, const qreal& pre |
|
|
|
if (UBDrawingController::drawingController()->isDrawingTool()) |
|
|
|
if (UBDrawingController::drawingController()->isDrawingTool()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
qreal width = 0; |
|
|
|
qreal width = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// delete current stroke, if not assigned to any polygon
|
|
|
|
|
|
|
|
if (mCurrentStroke) |
|
|
|
|
|
|
|
if (mCurrentStroke->polygons().empty()) |
|
|
|
|
|
|
|
delete mCurrentStroke; |
|
|
|
|
|
|
|
|
|
|
|
mCurrentStroke = new UBGraphicsStroke(); |
|
|
|
mCurrentStroke = new UBGraphicsStroke(); |
|
|
|
|
|
|
|
|
|
|
|
if (currentTool != UBStylusTool::Line) |
|
|
|
if (currentTool != UBStylusTool::Line) |
|
|
@ -344,8 +353,13 @@ bool UBGraphicsScene::inputDeviceRelease() |
|
|
|
UBDrawingController *dc = UBDrawingController::drawingController(); |
|
|
|
UBDrawingController *dc = UBDrawingController::drawingController(); |
|
|
|
if (dc->isDrawingTool())
|
|
|
|
if (dc->isDrawingTool())
|
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if (mCurrentStroke) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (mCurrentStroke->polygons().empty()) |
|
|
|
|
|
|
|
delete mCurrentStroke; |
|
|
|
mCurrentStroke = 0; |
|
|
|
mCurrentStroke = 0; |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (mRemovedItems.size() > 0 || mAddedItems.size() > 0) |
|
|
|
if (mRemovedItems.size() > 0 || mAddedItems.size() > 0) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -503,7 +517,6 @@ void UBGraphicsScene::drawLineTo(const QPointF &pEndPoint, const qreal &pWidth, |
|
|
|
|
|
|
|
|
|
|
|
if (mCurrentStroke) |
|
|
|
if (mCurrentStroke) |
|
|
|
{ |
|
|
|
{ |
|
|
|
mCurrentStroke->addPolygon(polygonItem); |
|
|
|
|
|
|
|
polygonItem->setStroke(mCurrentStroke); |
|
|
|
polygonItem->setStroke(mCurrentStroke); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|