haxiomic / firefox-multi-touch-zoom

Smoothly zoom in and out with the multi-touch pinch gesture
MIT License
153 stars 15 forks source link

Slight delay after zooming before page becomes interactive #14

Open haxiomic opened 6 years ago

haxiomic commented 6 years ago

It seems that when the scroll bars are made active after zooming the page is re-built which causes a noticeable hang

This work should be avoidable but I haven't yet found a workaround

mattia-donato commented 6 years ago

How to reproduce this issue?

haxiomic commented 6 years ago

If I zoom-in and immediately try two-finger panning, there's often a wait of about a few hundred ms to 1s before the panning works. If I run a performance recording in the dev tools there's a framerate drop right after the zoom where it does a 'layout' and a then a long 'paint' operation.

If I don't enable the scrollbars then this repaint doesn't occur but you can no longer pan

If I don't disable the scrollbars during zoom then the experience is choppy

I'm on a recent Macbook Pro and I've seen it happen under Windows so I've assuemd it's happening for everyone else but it's possible that it doesn't occur on your setup

PatrickGuthridge commented 6 years ago

I have fixed this issue by using requestAnimationFrame I have patched it here: #15

haxiomic commented 6 years ago

Unfortunately this doesn't resolve the issue for me, see comment https://github.com/haxiomic/firefox-multi-touch-zoom/pull/15/files#r178283167