Skip to content

Scrolling zoom is reversed if image viewer doesn't have focus#61222

Merged
mjbvz merged 1 commit intomicrosoft:masterfrom
balent:image-wheel-zoom
Oct 22, 2018
Merged

Scrolling zoom is reversed if image viewer doesn't have focus#61222
mjbvz merged 1 commit intomicrosoft:masterfrom
balent:image-wheel-zoom

Conversation

@balent
Copy link
Contributor

@balent balent commented Oct 18, 2018

Steps to reproduce:

  1. Open two split tabs with images next to each other.
  2. Try to zoom with Ctrl+Scroll on each of the images
  3. Notice that the image which doesn't have focus has reversed zoom in / zoom out

Issue is that when Ctrl is pressed and image viewer doesn't have focus, then "keydown" event is never received and "ctrlPressed" variable is never set to true.
However when "wheel" event is received, code checks for e.ctrlKey to detect pinching. Then pinching is incorrectly detected and on the line 522 the zoom direction is reversed.

In this solution I'm registering listeners globally so Ctrl event is received even when the image viewer doesn't have focus.

fixes partially #55470 - now scrolling will be consistent.

@bpasero bpasero assigned mjbvz and bpasero and unassigned bpasero Oct 22, 2018
@mjbvz mjbvz added this to the October 2018 milestone Oct 22, 2018
@mjbvz mjbvz merged commit 232cef5 into microsoft:master Oct 22, 2018
@mjbvz
Copy link
Collaborator

mjbvz commented Oct 22, 2018

Thanks!

@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants