From 03fd8fa46356a70c9eabcf7ca703ddaa5e16e96f Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Mon, 8 Jun 2015 14:53:29 +0200 Subject: Further tune curveThreshold setting based on strokeWidth ad9698713f91a2e706fcd391f9806057649632ff reduced the curvethreshold for wide lines, to fix QTBUG-46151. But as a side effect, the threshold was increased for lines of widths >=0 and <4. This commit fixes that, and also adds a lance test for the issue in QTBUG-46151. Change-Id: I52507db622435fe1d2646640cb0bd9cd8222e453 Reviewed-by: Gunnar Sletta --- src/gui/painting/qstroker_p.h | 2 +- tests/auto/other/lancelot/scripts/arcs2.qps | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gui/painting/qstroker_p.h b/src/gui/painting/qstroker_p.h index f967c091df..d3765bbd29 100644 --- a/src/gui/painting/qstroker_p.h +++ b/src/gui/painting/qstroker_p.h @@ -201,7 +201,7 @@ public: QStroker(); ~QStroker(); - void setStrokeWidth(qfixed width) { m_strokeWidth = width; m_curveThreshold = width >= 1 ? 1.0/width : 0.5;} + void setStrokeWidth(qfixed width) { m_strokeWidth = width; m_curveThreshold = qt_real_to_fixed(width > 4 ? 1.0/width : 0.25); } qfixed strokeWidth() const { return m_strokeWidth; } void setCapStyle(Qt::PenCapStyle capStyle) { m_capStyle = joinModeForCap(capStyle); } diff --git a/tests/auto/other/lancelot/scripts/arcs2.qps b/tests/auto/other/lancelot/scripts/arcs2.qps index 411ff08014..a2739a8c97 100644 --- a/tests/auto/other/lancelot/scripts/arcs2.qps +++ b/tests/auto/other/lancelot/scripts/arcs2.qps @@ -45,3 +45,10 @@ drawArc 100 350 300 300 5440 5760 drawArc 100 350 300 300 5600 5760 setPen white drawArc 100 350 300 300 0 5760 + +translate 400 300 +setRenderHint Antialiasing true +setPen blue 40 +drawArc 100 100 200 200 0 4320 +setPen red 40 +drawArc 60 60 280 280 0 4320 -- cgit v1.2.3