diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2020-07-22 12:50:00 +0200 |
---|---|---|
committer | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2020-08-12 07:10:23 +0200 |
commit | 4db44bc32f9a08e89391aa3d99a01060a4f10737 (patch) | |
tree | 5169faff001eda13b3c23ef73f59635d7f68ff25 /src/gui/painting | |
parent | 7bd965258e5c335f6fdba775ba84f787a0217950 (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
Pick-to: 5.15 5.12
Change-Id: I7cc3543d7aa4e90643b275686372400879decef2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/gui/painting')
-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 0a9f55f222..28b55f8431 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); } |