Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zooming out has a layout jump #8788

Open
juliushaertl opened this issue Apr 17, 2024 · 5 comments
Open

Zooming out has a layout jump #8788

juliushaertl opened this issue Apr 17, 2024 · 5 comments

Comments

@juliushaertl
Copy link
Member

juliushaertl commented Apr 17, 2024

Describe the Bug

When zooming out using the touchpad or using ctrl-scroll the position of the document changes

Steps to Reproduce

  1. Zoom in
  2. Move the cursor to the left or right part of the document area
  3. Zoom out using Ctrl-Scroll or the touchpad

Expected Behavior

The document just zooms out and directly is in the center target position

Actual Behavior

The document is first zoomed out in the right side of the browser window and then there is a layout jump where it is centered

Screenshots

writer-zoom-out-jumping.webm

Additional Context

COOLWSD version: 24.04.1.2 (git hash: 85fc0fd8)
LOKit version: Collabora Office 24.04.1.2 (git hash: da505b6)
Served by: Arch Linux
Server ID: 7d563b2f

@juliushaertl
Copy link
Member Author

juliushaertl commented Apr 17, 2024

I also noticed a very small layout shift when zooming in with ctrl-scroll/touchpad, sometimes more sometimes less, but there is a slight jump between stopping the zooming and when the actual higher resolution tiles are rendered

writer-zoom-jumping.webm

@juliushaertl
Copy link
Member Author

juliushaertl commented Apr 17, 2024

This is also visible with the zoom buttons, small papercut issue there would be that you have to wait until the zoom action was performed and cannot easily click multiple times to zoom in a couple of times:

writer-zoom-jumping-2.webm
writer-zoom-click-fast.webm

@pedropintosilva
Copy link
Contributor

pedropintosilva commented Apr 23, 2024

Today's discussion:

  • We could animate the jump (the jump that is already happening, that centers the document back in) could be a way forward, but might be tricky to get smooth
  • or as @marcoambrosini and @juliushaertl said we could: Ideally zoom out to center once the visible part of document is no longer exceeding the viewport

@pedropintosilva pedropintosilva added the enhancement New feature or request label Apr 23, 2024
@eszkadev
Copy link
Contributor

We could do it also this way:
a) when document width is completely visible on the screen -> zoom out with document at the center
b) when document width is visible partially (large zoom level or small window):

  • zoom out using "starting center",
  • when we reach edge of the document to be visible - use as boundary, move used center of zooming animation more to the real center of the document
  • when we reach point that full width of the document is visible - continue as in A)

@juliushaertl
Copy link
Member Author

juliushaertl commented Apr 23, 2024

a) when document width is completely visible on the screen -> zoom out with document at the center

Note that this seems to be already the case, just not once you start zooming out with scenario (b)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

3 participants