@@ -9,6 +9,7 @@ Item {
99 property int highlightedIndex: -1
1010 property var model: null
1111 property int leftMargin: 0
12+ property var spreadFlickable
1213
1314 // some config options
1415 property real contentMargin: 0.16 * root.height
@@ -133,10 +134,10 @@ Item {
133134 }
134135
135136 highlightedIndex = (highlightedIndex + 1) % totalItemCount;
136− var newContentX = ((spreadTotalWidth) / (totalItemCount + 1)) * Math.max(0, Math.min(totalItemCount - 5, highlightedIndex - 3));
137−// if (spreadFlickable.contentX < newContentX || spreadRepeater.highlightedIndex == 0) {
138−// spreadFlickable.snapTo(newContentX)
139−// }
137+ var newContentX = (spreadTotalWidth / (totalItemCount + 1)) * Math.max(0, Math.min(totalItemCount - 1, highlightedIndex - 1));
138+ if (spreadFlickable.contentX < newContentX || highlightedIndex == 0) {
139+ spreadFlickable.contentX = newContentX;
140+ }
140141 }
141142
142143 function selectPrevious(isAutoRepeat) {
@@ -146,10 +147,10 @@ Item {
146147
147148 var newIndex = highlightedIndex - 1 >= 0 ? highlightedIndex - 1 : totalItemCount - 1;
148149 highlightedIndex = newIndex;
149−// var newContentX = ((spreadFlickable.contentWidth) / (topLevelSurfaceList.count + 1)) * Math.max(0, Math.min(topLevelSurfaceList.count - 5, spreadRepeater.highlightedIndex - 1));
150−// if (spreadFlickable.contentX > newContentX || newIndex == topLevelSurfaceList.count -1) {
151−// spreadFlickable.snapTo(newContentX)
152−// }
150+ var newContentX = (spreadFlickable.contentWidth / (totalItemCount + 1)) * Math.max(0, Math.min(totalItemCount - 1, highlightedIndex - 1));
151+ if (spreadFlickable.contentX > newContentX || newIndex == totalItemCount - 1) {
152+ spreadFlickable.contentX = newContentX
153+ }
153154 }
154155
155156}