summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qstroker_p.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-05-20 18:22:40 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-05-22 05:45:38 +0000
commitad9698713f91a2e706fcd391f9806057649632ff (patch)
tree81f2220a020cee23bc9ab72264b45c53d212c106 /src/gui/painting/qstroker_p.h
parent9d9450f5f962059a405a66a08274ec51a0537c31 (diff)
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>
Diffstat (limited to 'src/gui/painting/qstroker_p.h')
-rw-r--r--src/gui/painting/qstroker_p.h2
1 files changed, 1 insertions, 1 deletions
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); }