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. 5322998a0b

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>
bb10
Eirik Aavitsland 2020-07-22 12:50:00 +02:00
parent 7bd965258e
commit 4db44bc32f
1 changed files with 5 additions and 1 deletions

View File

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