diff options
author | Trond Kjernåsen <trond@trolltech.com> | 2009-05-18 07:59:06 (GMT) |
---|---|---|
committer | Trond Kjernåsen <trond@trolltech.com> | 2009-05-18 08:02:35 (GMT) |
commit | 97d0f8f43db98e1c5ae49bd32dfc027e6d3a1349 (patch) | |
tree | f2beaca2d6a06c70dde73a385b712afe8578cb92 /src/gui | |
parent | b3db2368b63f3d7f0a8abbb0620232d8aa079ad7 (diff) | |
download | Qt-97d0f8f43db98e1c5ae49bd32dfc027e6d3a1349.zip Qt-97d0f8f43db98e1c5ae49bd32dfc027e6d3a1349.tar.gz Qt-97d0f8f43db98e1c5ae49bd32dfc027e6d3a1349.tar.bz2 |
Fixed a bug which implicitly closed perspective transformed poly lines.
When the end point of a line in a path is clipped, only closed paths
should have the closing line.
Task-number: 253663
Reviewed-by: Samuel
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/painting/qtransform.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp index 2383272..cec2d16 100644 --- a/src/gui/painting/qtransform.cpp +++ b/src/gui/painting/qtransform.cpp @@ -1355,7 +1355,8 @@ static inline QHomogeneousCoordinate mapHomogeneous(const QTransform &transform, return c; } -static inline bool lineTo_clipped(QPainterPath &path, const QTransform &transform, const QPointF &a, const QPointF &b, bool needsMoveTo) +static inline bool lineTo_clipped(QPainterPath &path, const QTransform &transform, const QPointF &a, const QPointF &b, + bool needsMoveTo, bool needsLineTo = true) { QHomogeneousCoordinate ha = mapHomogeneous(transform, a); QHomogeneousCoordinate hb = mapHomogeneous(transform, b); @@ -1388,7 +1389,8 @@ static inline bool lineTo_clipped(QPainterPath &path, const QTransform &transfor if (needsMoveTo) path.moveTo(ha.toPoint()); - path.lineTo(hb.toPoint()); + if (needsLineTo) + path.lineTo(hb.toPoint()); return true; } @@ -1455,7 +1457,7 @@ static QPainterPath mapProjective(const QTransform &transform, const QPainterPat } if (path.elementCount() > 0 && lastMoveTo != last) - lineTo_clipped(result, transform, last, lastMoveTo, needsMoveTo); + lineTo_clipped(result, transform, last, lastMoveTo, needsMoveTo, false); return result; } |