aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2011-08-19 10:32:27 +1000
committerQt by Nokia <qt-info@nokia.com>2011-08-19 02:50:31 +0200
commit5deb2f91286834aabbc18e4eb1d5c2805624b64b (patch)
tree72cdfa656baf11301c9abd6e9f881c4c29710e77
parent08e37a16c202364b0b919653f3a17979388cac27 (diff)
Fix spacing issue
Spacing was being incorrectly applied in circumstances where invisible items existed at the end of a positioner. Task-number: QTBUG-20961 Change-Id: I49ebc8e96a1564c0ff2bde1c1bb3f91d3c441488 Reviewed-on: http://codereview.qt.nokia.com/3232 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
-rw-r--r--src/declarative/items/qsgpositioners.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/declarative/items/qsgpositioners.cpp b/src/declarative/items/qsgpositioners.cpp
index df3450e4d7..fca0aa1877 100644
--- a/src/declarative/items/qsgpositioners.cpp
+++ b/src/declarative/items/qsgpositioners.cpp
@@ -533,10 +533,11 @@ void QSGColumn::doPositioning(QSizeF *contentSize)
contentSize->setWidth(qMax(contentSize->width(), child.item->width()));
voffset += child.item->height();
- if (ii != positionedItems.count() - 1)
- voffset += spacing();
+ voffset += spacing();
}
+ if (voffset != 0)//If we positioned any items, undo the spacing from the last item
+ voffset -= spacing();
contentSize->setHeight(voffset);
}
@@ -734,10 +735,11 @@ void QSGRow::doPositioning(QSizeF *contentSize)
contentSize->setHeight(qMax(contentSize->height(), child.item->height()));
hoffset += child.item->width();
- if (ii != positionedItems.count() - 1)
- hoffset += spacing();
+ hoffset += spacing();
}
+ if (hoffset != 0)//If we positioned any items, undo the extra spacing from the last item
+ hoffset -= spacing();
contentSize->setWidth(hoffset);
if (d->isLeftToRight())