summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond@trolltech.com>2009-05-18 09:59:06 +0200
committerTrond Kjernåsen <trond@trolltech.com>2009-05-18 10:02:35 +0200
commit97d0f8f43db98e1c5ae49bd32dfc027e6d3a1349 (patch)
treef2beaca2d6a06c70dde73a385b712afe8578cb92 /src/gui
parentb3db2368b63f3d7f0a8abbb0620232d8aa079ad7 (diff)
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.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp
index 2383272ad8..cec2d160ac 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;
}