summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2020-07-22 12:50:00 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-08-21 11:56:31 +0000
commitaebbcfbae3670f4299183bcd92977a61b70b4213 (patch)
treefced209b957181eea93c8ed5825f425d9c43c77e
parentf999d2c34e32909b0299c48c021609ed620942b5 (diff)
Allow smooth curve stroking for very wide lines
The earlier limit set on the curve threshold turned out to be too strict, leading to visibly bad rendering in reasonable use cases. Ref. 5322998a0ba80b1e095340245ddb00aaf5947be9 As a drive-by, add a missing fixed-to-real conversion. (This is a no-op in a default build, where qfixed==qreal.) Fixes: QTBUG-85193 Change-Id: I7cc3543d7aa4e90643b275686372400879decef2 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 4db44bc32f9a08e89391aa3d99a01060a4f10737) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/gui/painting/qstroker_p.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/painting/qstroker_p.h b/src/gui/painting/qstroker_p.h
index 3207f1944b..06446ae3df 100644
--- a/src/gui/painting/qstroker_p.h
+++ b/src/gui/painting/qstroker_p.h
@@ -209,7 +209,11 @@ public:
QStroker();
~QStroker();
- void setStrokeWidth(qfixed width) { m_strokeWidth = width; m_curveThreshold = qt_real_to_fixed(qBound(0.025, 1.0/width, 0.25)); }
+ void setStrokeWidth(qfixed width)
+ {
+ m_strokeWidth = width;
+ m_curveThreshold = qt_real_to_fixed(qBound(0.00025, 1.0 / qt_fixed_to_real(width), 0.25));
+ }
qfixed strokeWidth() const { return m_strokeWidth; }
void setCapStyle(Qt::PenCapStyle capStyle) { m_capStyle = joinModeForCap(capStyle); }