diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2020-07-22 12:50:00 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-08-12 07:15:53 +0000 |
commit | 58af0a3db5e59c3d7240b3c036cb973c2dc982ec (patch) | |
tree | 25d125eaa0bad7567ed9c06d92e05d31a6bf3908 | |
parent | caa68b9c538aa30ec6fc3feed2847fbe53d904b6 (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.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/painting/qstroker_p.h b/src/gui/painting/qstroker_p.h index 7df766e9a3..fb7704d573 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); } |