Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix zoom on first click #83826

Merged
merged 3 commits into from Nov 5, 2019
Merged

Fix zoom on first click #83826

merged 3 commits into from Nov 5, 2019

Conversation

@MartinBrathen
Copy link
Contributor

MartinBrathen commented Nov 1, 2019

This PR fixes #81877

The problem was that fast clicks would zoom on first click. I fixed this by adding the state variable isActive that keeps track of when the preview is active or not.

I also changed the name of a function from changeActive(value) to setActive(value) to make the code more intuitive.

I moved a postMessage call out of the update() function to avoid unnecessary calls.

Please let me know if any of these last two changes are unwanted and I'll revert them.

@MartinBrathen

This comment has been minimized.

Copy link
Contributor Author

MartinBrathen commented Nov 1, 2019

@mjbvz I've found a bug where the webviewEditor.onDidChangeViewState eventhandler will not be called in the case where the user performs these actions:

  1. Open two images in split view. Image A & B.
  2. Click on image A to ensure it has focus.
  3. press ctrl | alt + [appropriate number] to give image B focus.
  4. Now click on image A

webviewEditor.onDidChangeViewState should get triggered and you should also see how image A gains focus, but this does not happen.

When trying this on stable 1.39.2 the same visual bug appears, where image A does not seem to get focus.

This bug effects this PR and #82074 since both rely on webviewEditor.onDidChangeViewState being triggered.

webviewEditor.onDidChangeViewState(() => {

@mjbvz mjbvz self-assigned this Nov 1, 2019
@mjbvz mjbvz merged commit c53db9b into microsoft:master Nov 5, 2019
5 checks passed
5 checks passed
linux
Details
windows
Details
darwin
Details
VS Code #20191101.32 succeeded
Details
license/cla All CLA requirements met.
Details
@mjbvz

This comment has been minimized.

Copy link
Contributor

mjbvz commented Nov 5, 2019

Thanks. The fix looks good! Can you open a new issue for the webview problem so I can investigate

@mjbvz mjbvz added this to the November 2019 milestone Nov 5, 2019
@MartinBrathen

This comment has been minimized.

Copy link
Contributor Author

MartinBrathen commented Nov 5, 2019

Thanks! I'll have it done by tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.