erasers performance: pragmas

preferencesAboutTextFull
Anatoly Mihalchenko 12 years ago
parent 0fc1a4df92
commit 2e7efcd568
  1. 16
      src/domain/UBGraphicsScene.cpp

@ -768,15 +768,21 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth)
itemPainterPath.addPolygon(pi->sceneTransform().map(pi->polygon())); itemPainterPath.addPolygon(pi->sceneTransform().map(pi->polygon()));
if (eraserPath.contains(itemPainterPath)) if (eraserPath.contains(itemPainterPath))
{ {
// Compele remove item #pragma omp critical
intersectedItems << pi; {
intersectedPolygons << QPolygonF(); // Compele remove item
intersectedItems << pi;
intersectedPolygons << QPolygonF();
}
} }
else if (eraserPath.intersects(itemPainterPath)) else if (eraserPath.intersects(itemPainterPath))
{ {
QPainterPath newPath = itemPainterPath.subtracted(eraserPath); QPainterPath newPath = itemPainterPath.subtracted(eraserPath);
intersectedItems << pi; #pragma omp critical
intersectedPolygons << newPath.simplified().toFillPolygon(pi->sceneTransform().inverted()); {
intersectedItems << pi;
intersectedPolygons << newPath.simplified().toFillPolygon(pi->sceneTransform().inverted());
}
} }
} }

Loading…
Cancel
Save