New issue
Advanced search Search tips

Issue 715670 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

Chrome PDF scrollwheel zooming should center the zoom on the mouse position

Project Member Reported by dsinclair@chromium.org, Apr 26 2017

Issue description

Currently, scrolling with the ctrl+mouse wheel will zoom the PDF document in/out. But, the display location of the document seems.... random. We should switch the display to zoom around the mouse location instead of what it's currently doing.
 
Cc: wjmaclean@chromium.org
We should behave in the same way as web pages. How is it handled there?
The pdf viewer is separate from web pages, I'm not sure if we need to do the exact same thing. (I believe we are currently doing the same thing as Blink).

The desire for this is if you have a large document, zooming into a specific part of that document is difficult. Being able to zoom at the point the mouse is pointed at makes it a lot simpler.
Labels: Needs-Feedback
Owner: dsinclair@chromium.org
dsinclair, is there someone familiar with how zoom, especially for PDFs work, that should look at how difficult this change would be?
Cc: mcnee@chromium.org
+ mcnee@, who has some knowledge of how PDF zoom works.

Comment 5 by mcnee@chromium.org, Oct 12 2017

Zoom changes for the pdf viewer preserve the scroll position, which I believe is the same behaviour as web pages.

We're going to use the ctrl wheel events for mac pinch zooming ( crbug.com/715662 ). The mouse position will be the anchor in that case. So we should get the same behaviour for non-pinch ctrl wheel events.
Cc: hnakashima@chromium.org dsinclair@chromium.org
Labels: -Needs-Feedback
Owner: ----
Status: Available (was: Untriaged)
This is very useful in maps and other documents with large pages.

I don't think we need to worry about matching what Blink does, as PDFs have fixed page dimensions while webpages adjust to the viewport. The meaning of zoom in each case is different.
Blocking: 775515

Comment 8 by mcnee@chromium.org, Oct 20 2017

Owner: mcnee@chromium.org
Status: Started (was: Available)
Project Member

Comment 9 by bugdroid1@chromium.org, Nov 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bc61eb6a67219aa4352a4767d62d5b46719ca03e

commit bc61eb6a67219aa4352a4767d62d5b46719ca03e
Author: Kevin McNee <mcnee@chromium.org>
Date: Mon Nov 13 20:39:14 2017

PDF viewer: Handle ctrl-wheel zooming with the viewer's pinch zoom mechanism.

When pinch zooming with a Mac trackpad, we generate synthetic ctrl-wheels
so that JS can handle the gesture. We now use these wheel events in the
PDF viewer's gesture detector to create pinch events for the viewer's
pinch zoom mechanism, as we currently do for pinches from touch events.

We also use this for non-synthetic ctrl-wheels. This allows us to have
zooming with the mouse wheel anchor the zoom around the mouse position
instead of the scroll position.

Bug:  715662 ,  715670 
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Ia672a266cdd69c3e87d1451548c7470176ed8fd6
Reviewed-on: https://chromium-review.googlesource.com/730648
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Commit-Queue: Kevin McNee <mcnee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516034}
[modify] https://crrev.com/bc61eb6a67219aa4352a4767d62d5b46719ca03e/chrome/browser/pdf/pdf_extension_test.cc
[modify] https://crrev.com/bc61eb6a67219aa4352a4767d62d5b46719ca03e/chrome/browser/resources/pdf/gesture_detector.js
[modify] https://crrev.com/bc61eb6a67219aa4352a4767d62d5b46719ca03e/chrome/test/data/pdf/gesture_detector_test.js
[modify] https://crrev.com/bc61eb6a67219aa4352a4767d62d5b46719ca03e/content/public/test/browser_test_utils.cc
[modify] https://crrev.com/bc61eb6a67219aa4352a4767d62d5b46719ca03e/content/public/test/browser_test_utils.h

Comment 10 by mcnee@chromium.org, Nov 14 2017

Status: Fixed (was: Started)
Blocking: -775515

Sign in to add a comment