From a33e3d8a7fefc3d2ad254dcb76a127b068b7c63d Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Tue, 25 Aug 2009 09:08:47 +1000 Subject: Fix list startPosition calculation. --- src/declarative/fx/qfxlistview.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp index 8dfe171..59ece18 100644 --- a/src/declarative/fx/qfxlistview.cpp +++ b/src/declarative/fx/qfxlistview.cpp @@ -212,8 +212,11 @@ public: qreal startPosition() const { qreal pos = 0; - if (!visibleItems.isEmpty()) - pos = visibleItems.first()->position() - visibleIndex * (averageSize + spacing); + if (!visibleItems.isEmpty()) { + pos = visibleItems.first()->position(); + if (visibleIndex > 0) + pos -= visibleIndex * (averageSize + spacing) - spacing; + } return pos; } -- cgit v0.12