changed old compass behavior to match with new strokes simplification

preferencesAboutTextFull
Clément Fauconnier 7 years ago
parent 66447700d7
commit 1dcd59e307
  1. 1
      src/domain/UBGraphicsScene.cpp
  2. 11
      src/frameworks/UBGeometryUtils.cpp

@ -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.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();
}

Loading…
Cancel
Save