From ad9698713f91a2e706fcd391f9806057649632ff Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 20 May 2015 18:22:40 +0200 Subject: Adjust curveThreshold based on strokeWidth Currently curveThreshold is relative to pen width, this allows wide pen to be increasingly off target. This patch adjust the curveThreshold relative to stroke width, thereby ensuring wide pens stays on the curve. Task-number: QTBUG-46151 Change-Id: Ifd4371aa2853331d02e3c6f6565c243eb1b7ed2e Reviewed-by: Gunnar Sletta --- src/gui/painting/qstroker_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/painting/qstroker_p.h b/src/gui/painting/qstroker_p.h index eda65b8e2f..f967c091df 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; } + void setStrokeWidth(qfixed width) { m_strokeWidth = width; m_curveThreshold = width >= 1 ? 1.0/width : 0.5;} qfixed strokeWidth() const { return m_strokeWidth; } void setCapStyle(Qt::PenCapStyle capStyle) { m_capStyle = joinModeForCap(capStyle); } -- cgit v1.2.3