aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickflickable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/items/qquickflickable.cpp')
-rw-r--r--src/quick/items/qquickflickable.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp
index fed4bbec5e..979548e737 100644
--- a/src/quick/items/qquickflickable.cpp
+++ b/src/quick/items/qquickflickable.cpp
@@ -2320,20 +2320,22 @@ qreal QQuickFlickable::vHeight() const
bool QQuickFlickable::xflick() const
{
Q_D(const QQuickFlickable);
- if ((d->flickableDirection & QQuickFlickable::AutoFlickIfNeeded) && (vWidth() > width()))
+ const int contentWidthWithMargins = d->contentItem->width() + d->hData.startMargin + d->hData.endMargin;
+ if ((d->flickableDirection & QQuickFlickable::AutoFlickIfNeeded) && (contentWidthWithMargins > width()))
return true;
if (d->flickableDirection == QQuickFlickable::AutoFlickDirection)
- return std::floor(qAbs(vWidth() - width()));
+ return std::floor(qAbs(contentWidthWithMargins - width()));
return d->flickableDirection & QQuickFlickable::HorizontalFlick;
}
bool QQuickFlickable::yflick() const
{
Q_D(const QQuickFlickable);
- if ((d->flickableDirection & QQuickFlickable::AutoFlickIfNeeded) && (vHeight() > height()))
+ const int contentHeightWithMargins = d->contentItem->height() + d->vData.startMargin + d->vData.endMargin;
+ if ((d->flickableDirection & QQuickFlickable::AutoFlickIfNeeded) && (contentHeightWithMargins > height()))
return true;
if (d->flickableDirection == QQuickFlickable::AutoFlickDirection)
- return std::floor(qAbs(vHeight() - height()));
+ return std::floor(qAbs(contentHeightWithMargins - height()));
return d->flickableDirection & QQuickFlickable::VerticalFlick;
}