diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-05-13 08:26:31 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-05-13 08:26:31 (GMT) |
commit | f9afc51f96b2b09d8be7fcd9bf080d1144643273 (patch) | |
tree | 9cfaefbd6f58d3bb47ab3be564bd74df0ff65ccb /src/gui/painting | |
parent | 5cbaaa1a8baf14b66efe89fe967a3e966dac659c (diff) | |
parent | 03415f5db33ee1d8af15b924f84b547a9ed8020b (diff) | |
download | Qt-f9afc51f96b2b09d8be7fcd9bf080d1144643273.zip Qt-f9afc51f96b2b09d8be7fcd9bf080d1144643273.tar.gz Qt-f9afc51f96b2b09d8be7fcd9bf080d1144643273.tar.bz2 |
Merge commit 'origin/4.5'
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qemulationpaintengine.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/gui/painting/qemulationpaintengine.cpp b/src/gui/painting/qemulationpaintengine.cpp index 3397c45..175f1ab 100644 --- a/src/gui/painting/qemulationpaintengine.cpp +++ b/src/gui/painting/qemulationpaintengine.cpp @@ -123,14 +123,30 @@ void QEmulationPaintEngine::stroke(const QVectorPath &path, const QPen &pen) real_engine->stroke(path, bgPen); } - QBrush brush = pen.brush(); + QPen copy = pen; Qt::BrushStyle style = qbrush_style(brush); if (style >= Qt::LinearGradientPattern && style <= Qt::ConicalGradientPattern) { const QGradient *g = brush.gradient(); + if (g->coordinateMode() > QGradient::LogicalMode) { - QPaintEngineEx::stroke(path, pen); - return; + if (g->coordinateMode() == QGradient::StretchToDeviceMode) { + QTransform mat = brush.transform(); + mat.scale(real_engine->painter()->device()->width(), real_engine->painter()->device()->height()); + brush.setTransform(mat); + copy.setBrush(brush); + real_engine->stroke(path, copy); + return; + } else if (g->coordinateMode() == QGradient::ObjectBoundingMode) { + QTransform mat = brush.transform(); + QRealRect r = path.controlPointRect(); + mat.translate(r.x1, r.y1); + mat.scale(r.x2 - r.x1, r.y2 - r.y1); + brush.setTransform(mat); + copy.setBrush(brush); + real_engine->stroke(path, copy); + return; + } } } |