Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.4.0 Beta2
-
None
Description
This can be demonstrated with qtwebengine/tests/manual/quick/pdf/pdfPageView.qml: if you zoom in or out a long way (using e.g. control-mousewheel), the page may remain scrolled out of the viewport, despite this call to returnToBounds():
PdfPageView { id: pageView ... onRenderScaleChanged: pageView.returnToBounds() ... BoundaryRule on y { id: bry objectName: "bry" minimumOvershoot: 100 maximumOvershoot: 100 minimum: Math.min(0, root.height - pageView.height) maximum: 0 } function returnToBounds() { bry.returnToBounds() brx.returnToBounds() } }
The reason is that QQuickBoundaryRule::returnToBounds() checks currentOvershoot() which simply returns d->currentOvershoot; but zooming only changed the Image's width and height, and therefore indirectly changed the size of the PdfPageView: the QML code did not directly set y as a result of zooming, so BoundaryRule did not intercept it, and therefore doesn't know that there is any overshoot. Both currentOvershoot and targetValue are outdated at that point.
Perhaps when the user calls returnToBounds(), we should assume there is a good reason, and be more thorough about checking. The way to fix it seems to be
d->targetValue = d->easedOvershoot(d->property.read().toReal());
Attachments
Issue Links
- depends on
-
QTBUG-106094 All Pointer Handlers need to use metaproperties on target() rather than calling setters directly
- Reported
- relates to
-
QTBUG-104769 pdfviewer example: Pinch zoom on laptop trackpad stops working if zoom way in
- Closed
Gerrit Reviews
For Gerrit Dashboard: QTBUG-105106 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
423041,6 | WIP Recheck current property value in BoundaryRule::returnToBounds() | dev | qt/qtdeclarative | Status: NEW | -2 | 0 |
423043,7 | WIP PdfPageView: enforce zoom limits consistently, don't get stuck | dev | qt/qtwebengine | Status: NEW | -2 | 0 |
429865,6 | PinchHandler: don't bypass property interceptors like BoundaryRule | dev | qt/qtdeclarative | Status: NEW | 0 | 0 |