summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2019-08-13 12:11:40 +0200
committerEirik Aavitsland <eirik.aavitsland@qt.io>2019-08-14 10:23:32 +0200
commit5322998a0ba80b1e095340245ddb00aaf5947be9 (patch)
tree887a34a628dd63eb8c46eb0e2245c84929ab3dd7 /src
parent63abcfcade946e64ea1c1213259cab8e2ad2df81 (diff)
Limit curve stroking threshold to reasonable range
Avoid unreasonable threshold values for extremely wide pens, since that can lead to a very high processing cost. The rare usecases where this would make a noticeable difference will necessarily also be using scaling, and so is anyway depending on setting a suitable curve threshold manually. Fixes: QTBUG-77241 Change-Id: I27cea7d566d144389bb430739fde4f6033c4a28c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src')
-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 59e4cc6a7b..7df766e9a3 100644
--- a/src/gui/painting/qstroker_p.h
+++ b/src/gui/painting/qstroker_p.h
@@ -209,7 +209,7 @@ public:
QStroker();
~QStroker();
- void setStrokeWidth(qfixed width) { m_strokeWidth = width; m_curveThreshold = qt_real_to_fixed(width > 4 ? 1.0/width : 0.25); }
+ void setStrokeWidth(qfixed width) { m_strokeWidth = width; m_curveThreshold = qt_real_to_fixed(qBound(0.025, 1.0/width, 0.25)); }
qfixed strokeWidth() const { return m_strokeWidth; }
void setCapStyle(Qt::PenCapStyle capStyle) { m_capStyle = joinModeForCap(capStyle); }