1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-26 22:41:17 +02:00

Desktop: Fixes #4201: Fixed context menu when the UI is zoomed in or out

This commit is contained in:
Laurent Cozic
2020-12-23 23:17:12 +00:00
parent 17edebb6b1
commit a9af58146b
5 changed files with 28 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ import bridge from '../../../../../services/bridge';
import { menuItems, ContextMenuOptions, ContextMenuItemType } from '../../../utils/contextMenu';
import MenuUtils from '@joplin/lib/services/commands/MenuUtils';
import CommandService from '@joplin/lib/services/CommandService';
import convertToScreenCoordinates from '../../../../utils/convertToScreenCoordinates';
const Resource = require('@joplin/lib/models/Resource');
@@ -20,7 +21,7 @@ function contextMenuElement(editor: any, x: number, y: number) {
const iframes = document.getElementsByClassName('tox-edit-area__iframe');
if (!iframes.length) return null;
const iframeRect = iframes[0].getBoundingClientRect();
const iframeRect = convertToScreenCoordinates(iframes[0].getBoundingClientRect());
if (iframeRect.x < x && iframeRect.y < y && iframeRect.right > x && iframeRect.bottom > y) {
const relativeX = x - iframeRect.x;