Snap pinch zoom gestures near the screen edge.
Pinch zooming in on elements near at the screen edges is difficult with pinch-
zoom since the gesture will never be exactly on the edge. This is especially
problematic when trying to pinch-zoom in on position:fixed elements.
This patch adds a margin around the screen, currently 100px. If the first pinch-
zoom gesture's center falls within the margin, we save the distance from the
edge as the "anchor adjustment" and add it to all pinch updates for this
gesture. The effect is that the pinch will behave as if the user created the
gesture exactly over the edge, however, still allows movement away from the
edge during the gesture.
This patch also fixes the Viewport::Pan method not to use
LTHI::ScrollLayerWithViewportSpaceDelta since it takes a screen-space delta and
converts it to a local delta using the layer's transform. This transform is
computed in CalcDrawProps and since we change the page_scale and immediately
pan, the new scale isn't reflected in the transform.
BUG=426138
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/
1207573002
Cr-Commit-Position: refs/heads/master@{#335925}