|
3 | 3 | * Licensed under the MIT License. See License.txt in the project root for license information.
|
4 | 4 | *--------------------------------------------------------------------------------------------*/
|
5 | 5 |
|
6 |
| -import { getZoomFactor } from 'vs/base/browser/browser'; |
| 6 | +import { getZoomFactor, isChrome } from 'vs/base/browser/browser'; |
7 | 7 | import * as dom from 'vs/base/browser/dom';
|
8 | 8 | import { createFastDomNode, FastDomNode } from 'vs/base/browser/fastDomNode';
|
9 | 9 | import { IMouseEvent, IMouseWheelEvent, StandardWheelEvent } from 'vs/base/browser/mouseEvent';
|
@@ -87,12 +87,12 @@ export class MouseWheelClassifier {
|
87 | 87 | }
|
88 | 88 |
|
89 | 89 | public acceptStandardWheelEvent(e: StandardWheelEvent): void {
|
90 |
| - const targetWindow = dom.getWindow(e.browserEvent); |
91 |
| - const osZoomFactor = targetWindow.devicePixelRatio / getZoomFactor(targetWindow); |
92 |
| - if (platform.isWindows || platform.isLinux) { |
93 |
| - // On Windows and Linux, the incoming delta events are multiplied with the OS zoom factor. |
| 90 | + if (isChrome) { |
| 91 | + const targetWindow = dom.getWindow(e.browserEvent); |
| 92 | + const pageZoomFactor = getZoomFactor(targetWindow); |
| 93 | + // On Chrome, the incoming delta events are multiplied with the OS zoom factor. |
94 | 94 | // The OS zoom factor can be reverse engineered by using the device pixel ratio and the configured zoom factor into account.
|
95 |
| - this.accept(Date.now(), e.deltaX / osZoomFactor, e.deltaY / osZoomFactor); |
| 95 | + this.accept(Date.now(), e.deltaX * pageZoomFactor, e.deltaY * pageZoomFactor); |
96 | 96 | } else {
|
97 | 97 | this.accept(Date.now(), e.deltaX, e.deltaY);
|
98 | 98 | }
|
|
0 commit comments