on xenial help sign in
Try to make LVWPH to behave consistently

doubles are not fun

commit5024acfab3af418798e1dd9a124fc53da2dcdf7d authorAlbert Astals <albert.astals@canonical.com> dateMon 15 Sep 2014, 17:28 (12 years ago) parente611784
2 files changed+3−2
plugins/Dash/listviewwithpageheader.cpp+1−1 tests/qmltests/Dash/tst_GenericScopeView.qml+2−1
plugins/Dash/listviewwithpageheader.cpp+1−1
@@ -530,7 +530,7 @@ void ListViewWithPageHeader::adjustHeader(qreal diff)
530530 // (but the header was not shown by it's own position)
531531 // or the header is partially shown and we are not doing a maximizeVisibleArea either
532532 const bool scrolledUp = m_previousContentY > contentY();
533− const bool notRebounding = contentY() + height() < contentHeight();
533+ const bool notRebounding = qRound(contentY() + height()) < qRound(contentHeight());
534534 const bool notShownByItsOwn = contentY() + diff >= m_headerItem->y() + m_headerItem->height();
535535 const bool maximizeVisibleAreaRunning = m_contentYAnimation->isRunning() && contentYAnimationType == ContentYAnimationMaximizeVisibleArea;
536536
tests/qmltests/Dash/tst_GenericScopeView.qml+2−1
@@ -99,6 +99,7 @@ Item {
9999 function scrollToEnd()
100100 {
101101 var categoryListView = findChild(genericScopeView, "categoryListView");
102+ waitForRendering(categoryListView);
102103 while (!categoryListView.atYEnd) {
103104 mouseFlick(genericScopeView, genericScopeView.width/2, genericScopeView.height - units.gu(8),
104105 genericScopeView.width/2, genericScopeView.y)
@@ -478,7 +479,7 @@ Item {
478479 verify(category1.expanded);
479480 tryCompare(category1, "height", category1.item.expandedHeight + seeAll1.height);
480481 tryCompareFunction(function() {
481− return genericScopeView.categoryView.contentY + category1.y + category1.height + genericScopeView.categoryView.pageHeader.height
482+ return genericScopeView.categoryView.contentY + category1.y + category1.height
482483 == genericScopeView.categoryView.contentHeight;}
483484 , true);
484485 }