aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickshapes
diff options
context:
space:
mode:
Diffstat (limited to 'src/quickshapes')
-rw-r--r--src/quickshapes/qquickshapecurverenderer.cpp11
-rw-r--r--src/quickshapes/qquickshapecurverenderer_p.h1
2 files changed, 9 insertions, 3 deletions
diff --git a/src/quickshapes/qquickshapecurverenderer.cpp b/src/quickshapes/qquickshapecurverenderer.cpp
index df24d6df9a..93ccca4596 100644
--- a/src/quickshapes/qquickshapecurverenderer.cpp
+++ b/src/quickshapes/qquickshapecurverenderer.cpp
@@ -148,6 +148,9 @@ void QQuickShapeCurveRenderer::setPath(int index, const QQuickPath *path)
auto &pathData = m_paths[index];
pathData.originalPath = path->path();
pathData.m_dirty |= PathDirty;
+ const auto *shapePath = qobject_cast<const QQuickShapePath *>(path);
+ if (shapePath)
+ pathData.pathHints = shapePath->pathHints();
}
void QQuickShapeCurveRenderer::setStrokeColor(int index, const QColor &color)
@@ -419,14 +422,16 @@ void QQuickShapeCurveRenderer::processPath(PathData *pathData)
static const bool doIntersetionSolving = !qEnvironmentVariableIntValue("QT_QUICKSHAPES_DISABLE_INTERSECTION_SOLVER");
static const bool useTriangulatingStroker = qEnvironmentVariableIntValue("QT_QUICKSHAPES_TRIANGULATING_STROKER");
static const bool simplifyPath = qEnvironmentVariableIntValue("QT_QUICKSHAPES_SIMPLIFY_PATHS");
+ static const QSGCurveProcessor::OverlapSolveMode overlapMode = qEnvironmentVariableIntValue("QT_QUICKSHAPES_WIP_CONCAVE_JOINT")
+ ? QSGCurveProcessor::FullOverlapSolve : QSGCurveProcessor::SkipConcaveJoinsSolve;
int &dirtyFlags = pathData->m_dirty;
if (dirtyFlags & PathDirty) {
if (simplifyPath)
- pathData->path = QQuadPath::fromPainterPath(pathData->originalPath.simplified());
+ pathData->path = QQuadPath::fromPainterPath(pathData->originalPath.simplified(), QQuadPath::PathLinear | QQuadPath::PathNonIntersecting | QQuadPath::PathNonOverlappingControlPointTriangles);
else
- pathData->path = QQuadPath::fromPainterPath(pathData->originalPath);
+ pathData->path = QQuadPath::fromPainterPath(pathData->originalPath, QQuadPath::PathHints(int(pathData->pathHints)));
pathData->path.setFillRule(pathData->fillRule);
pathData->fillPath = {};
dirtyFlags |= (FillDirty | StrokeDirty);
@@ -440,7 +445,7 @@ void QQuickShapeCurveRenderer::processPath(PathData *pathData)
QSGCurveProcessor::solveIntersections(pathData->fillPath);
pathData->fillPath.addCurvatureData();
if (doOverlapSolving)
- QSGCurveProcessor::solveOverlaps(pathData->fillPath);
+ QSGCurveProcessor::solveOverlaps(pathData->fillPath, overlapMode);
}
pathData->fillNodes = addFillNodes(*pathData);
dirtyFlags |= StrokeDirty;
diff --git a/src/quickshapes/qquickshapecurverenderer_p.h b/src/quickshapes/qquickshapecurverenderer_p.h
index 4b192a9218..f46521d4f7 100644
--- a/src/quickshapes/qquickshapecurverenderer_p.h
+++ b/src/quickshapes/qquickshapecurverenderer_p.h
@@ -98,6 +98,7 @@ private:
QPen pen;
bool validPenWidth = true;
int m_dirty = 0;
+ QQuickShapePath::PathHints pathHints;
QPainterPath originalPath;
QQuadPath path;