Details
-
Bug
-
Resolution: Unresolved
-
P4: Low
-
None
-
5.2.1
-
None
Description
I have a Flickable with contentHeight explicitely set to the contents' size. If the contents are empty, it gets set to zero.
This causes visibleArea.heightRatio to be changed to NaN, +inf or -inf because of the N/0 or 0/0 unchecked divisions inside QQuickFlickableVisibleArea::updateVisible:
const qreal viewheight = flickable->height(); const qreal maxyextent = -flickable->maxYExtent() + flickable->minYExtent(); qreal pagePos = (-p->vData.move.value() + flickable->minYExtent()) / (maxyextent + viewheight); qreal pageSize = viewheight / (maxyextent + viewheight);
If viewheight and maxyextent are both zero, this is a NaN. If they have the same nonzero value with opposite sign, this is a +inf/-inf.
The docs instead say that the ratio should be clamped to the 0.0-1.0 range.