summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>2015-09-22 13:52:40 +0200
committerGabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>2015-09-22 12:23:38 +0000
commitb35b0d60c8252b44e21e53922cba9c3a2d1abbc1 (patch)
tree65d7a04d808e6ac7f13889cea615b325e15fb462
parenta7397a37145cd226f0a8a7bf89bd51cdc1b69025 (diff)
downloadqtquickcontrols-b35b0d60c8252b44e21e53922cba9c3a2d1abbc1.tar.gz
ScrollViewStyle: Avoid division by zero in handle positioning
Change-Id: Iceef723a407f49d36b288e50df3dec9debbe9ba7 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
-rw-r--r--src/controls/Styles/Base/ScrollViewStyle.qml4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/controls/Styles/Base/ScrollViewStyle.qml b/src/controls/Styles/Base/ScrollViewStyle.qml
index f3478646..ed72951f 100644
--- a/src/controls/Styles/Base/ScrollViewStyle.qml
+++ b/src/controls/Styles/Base/ScrollViewStyle.qml
@@ -377,8 +377,8 @@ Style {
width: __styleData.horizontal ? extent : implicitWidth
anchors.top: bg.top
anchors.left: bg.left
- anchors.topMargin: __styleData.horizontal ? 0 : -handleOverlap + (2 * begin * (bg.height + (2 * handleOverlap) - extent) + range) / (2 * range)
- anchors.leftMargin: __styleData.horizontal ? -handleOverlap + (2 * begin * (bg.width + (2 * handleOverlap) - extent) + range) / (2 * range) : 0
+ anchors.topMargin: __styleData.horizontal || range === 0 ? 0 : -handleOverlap + (2 * begin * (bg.height + (2 * handleOverlap) - extent) + range) / (2 * range)
+ anchors.leftMargin: __styleData.horizontal && range !== 0 ? -handleOverlap + (2 * begin * (bg.width + (2 * handleOverlap) - extent) + range) / (2 * range) : 0
sourceComponent: handle
property QtObject styleData: QtObject {
readonly property bool hovered: activeControl === "handle"