diff options
author | Andreas Kling <andreas.kling@nokia.com> | 2010-09-12 17:19:52 (GMT) |
---|---|---|
committer | Andreas Kling <andreas.kling@nokia.com> | 2010-09-12 18:13:12 (GMT) |
commit | d9f5115eb7f7ba78db245ff9e66ae638317f5b70 (patch) | |
tree | d0242df26b6449bf836184a881813672c7e7b7b5 /src/gui/painting/qstroker.cpp | |
parent | 288244c528ca169d1a3b015e27fc9561d7094563 (diff) | |
download | Qt-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.
Diffstat (limited to 'src/gui/painting/qstroker.cpp')
-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 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 { |