Fixed issue 826

preferencesAboutTextFull
shibakaneki 13 years ago
parent 88f652245e
commit 902989e15b
  1. 4
      src/board/UBDrawingController.h
  2. 14
      src/domain/UBGraphicsScene.cpp

@ -65,6 +65,10 @@ class UBDrawingController : public QObject
mIsDesktopMode = mode; mIsDesktopMode = mode;
} }
bool isInDesktopMode(){
return mIsDesktopMode;
}
public slots: public slots:
void setStylusTool(int tool); void setStylusTool(int tool);

@ -779,7 +779,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
if (mShouldUseOMP) if (mShouldUseOMP)
{ {
//#pragma omp parallel for #pragma omp parallel for
for (int i = 0; i < collidItemsSize; i++) for (int i = 0; i < collidItemsSize; i++)
{ {
UBGraphicsPolygonItem *collidingPolygonItem = qgraphicsitem_cast<UBGraphicsPolygonItem*>(collidItems.at(i)); UBGraphicsPolygonItem *collidingPolygonItem = qgraphicsitem_cast<UBGraphicsPolygonItem*>(collidItems.at(i));
@ -789,7 +789,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
if(eraserInnerRect.contains(collidingPolygonItem->boundingRect())) if(eraserInnerRect.contains(collidingPolygonItem->boundingRect()))
{ {
//#pragma omp critical #pragma omp critical
// Put the entire polygon into the remove list // Put the entire polygon into the remove list
toBeRemovedItems << collidingPolygonItem; toBeRemovedItems << collidingPolygonItem;
} }
@ -826,7 +826,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
} }
else */if (croppedPathSimplified.isEmpty()) else */if (croppedPathSimplified.isEmpty())
{ {
//#pragma omp critical #pragma omp critical
// Put the entire polygon into the remove list if the eraser removes all its visible content // Put the entire polygon into the remove list if the eraser removes all its visible content
toBeRemovedItems << collidingPolygonItem; toBeRemovedItems << collidingPolygonItem;
} }
@ -837,7 +837,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
foreach(const QPolygonF &pol, croppedPathSimplified.toFillPolygons()) foreach(const QPolygonF &pol, croppedPathSimplified.toFillPolygons())
{ {
UBGraphicsPolygonItem* croppedPolygonItem = collidingPolygonItem->deepCopy(pol); UBGraphicsPolygonItem* croppedPolygonItem = collidingPolygonItem->deepCopy(pol);
//#pragma omp critical #pragma omp critical
if(NULL != pGroup){ if(NULL != pGroup){
croppedPolygonItem->setStrokesGroup(pGroup); croppedPolygonItem->setStrokesGroup(pGroup);
//pGroup->addToGroup(croppedPolygonItem); //pGroup->addToGroup(croppedPolygonItem);
@ -845,7 +845,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
// Add this new polygon to the 'added' list // Add this new polygon to the 'added' list
toBeAddedItems << croppedPolygonItem; toBeAddedItems << croppedPolygonItem;
} }
//#pragma omp critical #pragma omp critical
// Remove the original polygonitem because it has been replaced by many smaller polygons // Remove the original polygonitem because it has been replaced by many smaller polygons
toBeRemovedItems << collidingPolygonItem; toBeRemovedItems << collidingPolygonItem;
} }
@ -902,7 +902,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
} }
} }
if(eDrawingMode_Vector == UBDrawingController::drawingController()->drawingMode()){ if(eDrawingMode_Vector == DRAWING_MODE && !UBDrawingController::drawingController()->isInDesktopMode()){
foreach(QGraphicsItem* item, toBeRemovedItems){ foreach(QGraphicsItem* item, toBeRemovedItems){
UBGraphicsPolygonItem* poly = dynamic_cast<UBGraphicsPolygonItem*>(item); UBGraphicsPolygonItem* poly = dynamic_cast<UBGraphicsPolygonItem*>(item);
if(NULL != poly){ if(NULL != poly){
@ -920,7 +920,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
mRemovedItems += toBeRemovedItems; mRemovedItems += toBeRemovedItems;
} }
if(eDrawingMode_Vector == UBDrawingController::drawingController()->drawingMode()){ if(eDrawingMode_Vector == DRAWING_MODE && !UBDrawingController::drawingController()->isInDesktopMode()){
foreach(QGraphicsItem* item, toBeAddedItems){ foreach(QGraphicsItem* item, toBeAddedItems){
UBGraphicsPolygonItem* poly = dynamic_cast<UBGraphicsPolygonItem*>(item); UBGraphicsPolygonItem* poly = dynamic_cast<UBGraphicsPolygonItem*>(item);
if(NULL != poly && NULL != poly->strokesGroup()){ if(NULL != poly && NULL != poly->strokesGroup()){

Loading…
Cancel
Save