fix spread looking out of place when there's only one item
commitb2f2f1c729e54a92a051ae5b833bfdaffc1326f6
authorMichael Zanetti <michael.zanetti@canonical.com>
dateMon 7 Nov 2016, 13:37 (10 years ago)
parent12c377d
qml/Stage/Spread/Spread.qml+1−1
@@ -91,7 +91,7 @@ Item {
9191
9292 readonly property real visibleItemCount: (spreadWidth / spreadItemWidth) / (1 - itemOverlap)
9393
94− readonly property real spreadTotalWidth: totalItemCount * spreadWidth / visibleItemCount
94+ readonly property real spreadTotalWidth: Math.max(2,totalItemCount) * spreadWidth / visibleItemCount
9595
9696 readonly property real centeringOffset: Math.max(spreadWidth - spreadTotalWidth ,0) / (2 * spreadWidth)
9797