Hi,

On Fri, Jul 12, 2024 at 11:18:11PM +0200, a...@dismail.de wrote:
On Fri, 12 Jul 2024 12:04:30 -0600
paste...@gmx.com wrote:

Hi

with left mouse click on zoom button -> screen get bigger and screen
slides down - so when leaves the viewport it needs a scroll up so
center remains and zoom is userfull

with right mouse click on zoom button -> screen get smaller and
screen slides down - so when viewport is off the physical screena
scroll down - do nothing when viewport is <= the physical screen

Thats true. I think the zoom code right now just relies on a
StyleEngine action, which isn't really designed for that. What you
are suggesting would probably take quite a bit more work.

I think we could approximate it by assuming that each element will be magnified by the same amount.

Therefore, if you measure the distance in pixels of the current view from the top of the page, Y, and then you increase the zoom by a factor of 1.2, then you should scroll to 1.2*Y to compensate it. Here is a "graphical" visualization but in horizontal rather than vertically:

  0    5    10   15        0    5    10   15
  AAAABBBBCCCCDDDD   -->   AAAAABBBBBCCCCCDDDDD
            ^                          ^
            Y=10     x1.2              Y=12

This won't work with cases where the text is constrained into a container that has 100% width (or some other relative size), as it would change the breaking point of the lines, causing the scroll approximation to fail.

A more accurate and complex approach is to take the position of some elements in the current view, and then try to locate them after zooming and then scroll there.

I opened an issue here to track it:

https://github.com/dillo-browser/dillo/issues/221

Rodrigo.
_______________________________________________
Dillo-dev mailing list -- dillo-dev@mailman3.com
To unsubscribe send an email to dillo-dev-le...@mailman3.com

Reply via email to