Commit 1dcd59e3 authored by Clément Fauconnier's avatar Clément Fauconnier

changed old compass behavior to match with new strokes simplification

parent 66447700
......@@ -1094,6 +1094,7 @@ void UBGraphicsScene::drawArcTo(const QPointF& pCenterPoint, qreal pSpanAngle)
penWidth /= UBApplication::boardController->currentZoom();
mArcPolygonItem = arcToPolygonItem(QLineF(pCenterPoint, mPreviousPoint), pSpanAngle, penWidth);
mArcPolygonItem->setFillRule(Qt::WindingFill);
mArcPolygonItem->setStroke(mCurrentStroke);
mAddedItems.insert(mArcPolygonItem);
addItem(mArcPolygonItem);
......
......@@ -225,21 +225,12 @@ QPolygonF UBGeometryUtils::arcToPolygon(const QLineF& startRadius, qreal spanAng
endAngleInDegrees = - endAngleInDegrees;
spanAngleInDegrees = - spanAngleInDegrees;
if (overlap)
{
painterPath.addEllipse(outerSquare);
QPainterPath innerPainterPath;
innerPainterPath.addEllipse(innerSquare);
painterPath = painterPath.subtracted(innerPainterPath);
}
else
{
painterPath.arcTo(innerSquare, startAngleInDegrees, spanAngleInDegrees);
painterPath.arcTo(endSquare, 180.0 + endAngleInDegrees, spanAngleInDegrees > 0 ? -180.0 : 180.0);
painterPath.arcTo(outerSquare, endAngleInDegrees, - spanAngleInDegrees);
painterPath.arcTo(startSquare, startAngleInDegrees, spanAngleInDegrees > 0 ? -180.0 : 180.0);
painterPath.closeSubpath();
}
painterPath.setFillRule(Qt::WindingFill);
painterPath.arcTo(innerSquare, startAngleInDegrees, spanAngleInDegrees);
painterPath.arcTo(endSquare, 180.0 + endAngleInDegrees, spanAngleInDegrees > 0 ? -180.0 : 180.0);
painterPath.arcTo(outerSquare, endAngleInDegrees, - spanAngleInDegrees);
painterPath.arcTo(startSquare, startAngleInDegrees, spanAngleInDegrees > 0 ? -180.0 : 180.0);
painterPath.closeSubpath();
return painterPath.toFillPolygon();
}
......
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