Skip to content

Commit 2e55c84

Browse files
authored
fix(pdf-server): let zoom-out button go below fit (revert button floor) (#589)
Some hosts overlay UI on the iframe (chat composer, etc.) without reporting it in safeAreaInsets.bottom, so computeFitScale's 'fit' fills the iframe but the page bottom sits under the overlay. Flooring the zoom-out button at fit removed the only escape hatch. Pinch keeps the fit floor + rubber-band (it needs a defined snap point for the exit-to-inline gesture). The button now goes to ZOOM_MIN as before #587.
1 parent 721ccd0 commit 2e55c84

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

examples/pdf-server/src/mcp-app.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3340,13 +3340,13 @@ function zoomIn() {
33403340
renderPage().then(scrollSelectionIntoView);
33413341
}
33423342

3343-
async function zoomOut() {
3343+
function zoomOut() {
33443344
userHasZoomed = true;
3345-
// Fullscreen floor is fit-to-page (anything smaller is dead margin).
3346-
const fit =
3347-
currentDisplayMode === "fullscreen" ? await computeFitScale() : null;
3348-
const floor = fit !== null ? Math.max(ZOOM_MIN, fit) : ZOOM_MIN;
3349-
scale = Math.max(scale - 0.25, floor);
3345+
// Intentionally NOT floored at fit-to-page (unlike pinch). Hosts may
3346+
// overlay UI on the iframe without reporting it in safeAreaInsets, so
3347+
// "fit" can leave the page bottom hidden; the button is the escape hatch
3348+
// to shrink past it. Pinch still rubber-bands at fit (see commitPinch).
3349+
scale = Math.max(scale - 0.25, ZOOM_MIN);
33503350
renderPage().then(scrollSelectionIntoView);
33513351
}
33523352

0 commit comments

Comments
 (0)