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 <gunnar@sletta.org>
This commit is contained in:
Allan Sandfeld Jensen 2015-05-20 18:22:40 +02:00
parent 9d9450f5f9
commit ad9698713f

View File

@ -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); }