summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qprintengine_win.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-06-28 14:30:13 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-06-28 14:30:13 (GMT)
commit547c4f657991b47f8840b08c25d86d4abc180313 (patch)
treee339dc19a662db6ee87a14f9a53a942b36dba696 /src/gui/painting/qprintengine_win.cpp
parentec896e15bdc2b8c71a8e200faae3b4ecf429964a (diff)
parenta9177328bcac8960ebb19be7b709faaa216ee9d3 (diff)
downloadQt-547c4f657991b47f8840b08c25d86d4abc180313.zip
Qt-547c4f657991b47f8840b08c25d86d4abc180313.tar.gz
Qt-547c4f657991b47f8840b08c25d86d4abc180313.tar.bz2
Merge branch '4.5'
Diffstat (limited to 'src/gui/painting/qprintengine_win.cpp')
-rw-r--r--src/gui/painting/qprintengine_win.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/gui/painting/qprintengine_win.cpp b/src/gui/painting/qprintengine_win.cpp
index 72faf7c..f36028f 100644
--- a/src/gui/painting/qprintengine_win.cpp
+++ b/src/gui/painting/qprintengine_win.cpp
@@ -861,7 +861,25 @@ void QWin32PrintEnginePrivate::fillPath_dev(const QPainterPath &path, const QCol
void QWin32PrintEnginePrivate::strokePath_dev(const QPainterPath &path, const QColor &color, qreal penWidth)
{
composeGdiPath(path);
- HPEN pen = CreatePen(PS_SOLID, qRound(penWidth), RGB(color.red(), color.green(), color.blue()));
+ LOGBRUSH brush;
+ brush.lbStyle = BS_SOLID;
+ brush.lbColor = RGB(color.red(), color.green(), color.blue());
+ DWORD capStyle = PS_ENDCAP_SQUARE;
+ DWORD joinStyle = PS_JOIN_BEVEL;
+ if (pen.capStyle() == Qt::FlatCap)
+ capStyle = PS_ENDCAP_FLAT;
+ else if (pen.capStyle() == Qt::RoundCap)
+ capStyle = PS_ENDCAP_ROUND;
+
+ if (pen.joinStyle() == Qt::MiterJoin)
+ joinStyle = PS_JOIN_MITER;
+ else if (pen.joinStyle() == Qt::RoundJoin)
+ joinStyle = PS_JOIN_ROUND;
+
+ HPEN pen = ExtCreatePen(((penWidth == 0) ? PS_COSMETIC : PS_GEOMETRIC)
+ | PS_SOLID | capStyle | joinStyle,
+ penWidth, &brush, 0, 0);
+
HGDIOBJ old_pen = SelectObject(hdc, pen);
StrokePath(hdc);
DeleteObject(SelectObject(hdc, old_pen));