diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2019-06-14 10:34:15 +0200 |
---|---|---|
committer | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2019-06-14 11:02:35 +0200 |
commit | 1640973a826eccbefb8743bba6c5662a7b4e9fe9 (patch) | |
tree | ef864bd468b532cc022389df42d9f19a37ef203c /src/gui/painting | |
parent | dd5b829468b4818f00a3c3a7df7f104dfa869bd1 (diff) |
Fix raster paint error in path joins of tightly bending bezier curves
The code for generating round line joins is optimized with a shortcut
for the inner, normally invisible joins. For certain joins of a
tightly turning bezier, this optimization would lead to visible
painting error. Fix by avoiding the optimization if the next control
point is so close as to allow such tight turns.
As a driveby, make the angle > 90 test cheaper, since absolute
precision is not required in the optimization choice.
Fixes: QTBUG-75008
Change-Id: I293e0776003310dc36fa7f43fbcd9c25f1f8fa5d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qstroker.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/painting/qstroker.cpp b/src/gui/painting/qstroker.cpp index 56d0917c6c..43dd191be8 100644 --- a/src/gui/painting/qstroker.cpp +++ b/src/gui/painting/qstroker.cpp @@ -524,7 +524,7 @@ void QStroker::joinPoints(qfixed focal_x, qfixed focal_y, const QLineF &nextLine QLineF shortCut(prevLine.p2(), nextLine.p1()); qreal angle = shortCut.angleTo(prevLine); - if (type == QLineF::BoundedIntersection || (angle > 90 && !qFuzzyCompare(angle, (qreal)90))) { + if ((type == QLineF::BoundedIntersection || (angle > qreal(90.01))) && nextLine.length() > offset) { emitLineTo(focal_x, focal_y); emitLineTo(qt_real_to_fixed(nextLine.x1()), qt_real_to_fixed(nextLine.y1())); return; |