erasers performance: pragmas

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

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

Loading…
Cancel
Save