From bf284c2bbdf783340a2f35350fd5ea690b3192b2 Mon Sep 17 00:00:00 2001 From: Louai Al-Khanji Date: Mon, 12 May 2014 15:35:49 +0300 Subject: [PATCH] Direct2D QPA: Fix check for cosmetic pen When checking whether a QPen should be treated as cosmetic we need to take into account the render hints set on the painter as well. Change-Id: I8200611af08000d2d1626d8ef97eb3f6dac4951c Reviewed-by: Risto Avila Reviewed-by: Andrew Knight --- .../platforms/direct2d/qwindowsdirect2dpaintengine.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp index ca2dcf908d..5a4157565e 100644 --- a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp +++ b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp @@ -592,9 +592,13 @@ public: props.miterLimit = newPen.miterLimit() * qreal(2.0); // D2D and Qt miter specs differ props.dashOffset = newPen.dashOffset(); - props.transformType = qIsNull(newPen.widthF()) ? D2D1_STROKE_TRANSFORM_TYPE_HAIRLINE - : newPen.isCosmetic() ? D2D1_STROKE_TRANSFORM_TYPE_FIXED - : D2D1_STROKE_TRANSFORM_TYPE_NORMAL; + + if (newPen.widthF() == 0) + props.transformType = D2D1_STROKE_TRANSFORM_TYPE_HAIRLINE; + else if (qt_pen_is_cosmetic(newPen, q->state()->renderHints)) + props.transformType = D2D1_STROKE_TRANSFORM_TYPE_FIXED; + else + props.transformType = D2D1_STROKE_TRANSFORM_TYPE_NORMAL; switch (newPen.style()) { case Qt::SolidLine: