aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgcurveprocessor.cpp
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2024-01-23 12:49:25 +0100
committerEirik Aavitsland <eirik.aavitsland@qt.io>2024-01-24 16:43:44 +0100
commitf932f8c86d35cb5ab52f21ec810893a429a3622c (patch)
tree698ea8ec03fa740e9d73ade9983b6bd25c409b05 /src/quick/scenegraph/qsgcurveprocessor.cpp
parent7abc35acf850e35734a6873a34daff702eb56acc (diff)
Curverenderer: Simplify the workaround for 3 element paths
For a single triangle inner hull, qTriangulate() will sometimes give an unexpected result in the index list. Fix by overwriting it with the expected result, since that is static and known for this simple case. Pick-to: 6.7 Change-Id: I76d697f85f233b0c2ecc50da3074def89e860697 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/quick/scenegraph/qsgcurveprocessor.cpp')
-rw-r--r--src/quick/scenegraph/qsgcurveprocessor.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgcurveprocessor.cpp b/src/quick/scenegraph/qsgcurveprocessor.cpp
index 57b248c520..012c7b0747 100644
--- a/src/quick/scenegraph/qsgcurveprocessor.cpp
+++ b/src/quick/scenegraph/qsgcurveprocessor.cpp
@@ -1684,6 +1684,9 @@ void QSGCurveProcessor::processFill(const QQuadPath &fillPath,
};
QTriangleSet triangles = qTriangulate(internalHull);
+ // Workaround issue in qTriangulate() for single-triangle path
+ if (triangles.indices.size() == 3)
+ triangles.indices.setDataUint({ 0, 1, 2 });
const quint32 *idxTable = static_cast<const quint32 *>(triangles.indices.data());
for (int triangle = 0; triangle < triangles.indices.size() / 3; ++triangle) {