mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
feat: add scroll wheel zoom setting (#9476)
### Changed Add `scroll wheel to zoom` setting option, when the option enables, user can zoom in and out with scroll wheel without pressing the cmd/ctrl key.
This commit is contained in:
@@ -825,11 +825,14 @@ export async function clickComponentToolbarMoreMenuButton(
|
||||
export async function zoomByMouseWheel(
|
||||
page: Page,
|
||||
stepX: number,
|
||||
stepY: number
|
||||
stepY: number,
|
||||
pressedKey = true
|
||||
) {
|
||||
await page.keyboard.down(SHORT_KEY);
|
||||
if (pressedKey) await page.keyboard.down(SHORT_KEY);
|
||||
|
||||
await page.mouse.wheel(stepX, stepY);
|
||||
await page.keyboard.up(SHORT_KEY);
|
||||
|
||||
if (pressedKey) await page.keyboard.up(SHORT_KEY);
|
||||
}
|
||||
|
||||
// touch screen is not supported by Playwright now
|
||||
|
||||
Reference in New Issue
Block a user