summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Kling <andreas.kling@nokia.com>2010-09-12 17:19:52 (GMT)
committerAndreas Kling <andreas.kling@nokia.com>2010-09-12 18:13:12 (GMT)
commitd9f5115eb7f7ba78db245ff9e66ae638317f5b70 (patch)
treed0242df26b6449bf836184a881813672c7e7b7b5
parent288244c528ca169d1a3b015e27fc9561d7094563 (diff)
downloadQt-d9f5115eb7f7ba78db245ff9e66ae638317f5b70.zip
Qt-d9f5115eb7f7ba78db245ff9e66ae638317f5b70.tar.gz
Qt-d9f5115eb7f7ba78db245ff9e66ae638317f5b70.tar.bz2
QStroker: Fix erroneous SvgMiterJoin behavior for parallel lines
QLineF::intersect() yields an undefined intersectionPoint for parallel lines. Thus if the distance to 0,0 is shorter than the current miter limit, we would draw a triangle to 0,0. Handle this by not drawing the triangle for parallel lines. This matches the behavior of Qt::MiterJoin.
-rw-r--r--src/gui/painting/qstroker.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/painting/qstroker.cpp b/src/gui/painting/qstroker.cpp
index eabbd8a..9cff339 100644
--- a/src/gui/painting/qstroker.cpp
+++ b/src/gui/painting/qstroker.cpp
@@ -609,7 +609,7 @@ void QStroker::joinPoints(qfixed focal_x, qfixed focal_y, const QLineF &nextLine
}
QLineF miterLine(QPointF(qt_fixed_to_real(focal_x),
qt_fixed_to_real(focal_y)), isect);
- if (miterLine.length() > qt_fixed_to_real(m_strokeWidth * m_miterLimit) / 2) {
+ if (type == QLineF::NoIntersection || miterLine.length() > qt_fixed_to_real(m_strokeWidth * m_miterLimit) / 2) {
emitLineTo(qt_real_to_fixed(nextLine.x1()),
qt_real_to_fixed(nextLine.y1()));
} else {