fixed context menu positioning when scaling is active

This commit is contained in:
zadam
2020-05-11 20:08:55 +02:00
parent b365c186a1
commit 88e8eb7e9c
4 changed files with 40 additions and 25 deletions

View File

@@ -8,6 +8,7 @@ import contextMenu from "./services/context_menu.js";
import DesktopMainWindowLayout from "./layouts/desktop_main_window_layout.js";
import glob from "./services/glob.js";
import DesktopExtraWindowLayout from "./layouts/desktop_extra_window_layout.js";
import zoomService from './services/zoom.js';
glob.setupGlobs();
@@ -133,9 +134,11 @@ if (utils.isElectron()) {
return;
}
const zoomLevel = zoomService.getCurrentZoom();
contextMenu.show({
x: params.x,
y: params.y,
x: params.x / zoomLevel,
y: params.y / zoomLevel,
items,
selectMenuItemHandler: ({command, spellingSuggestion}) => {
if (command === 'replaceMisspelling') {
@@ -144,4 +147,4 @@ if (utils.isElectron()) {
}
});
});
}
}