improvement: change hint for 2-point lines on resize (#2655)

This commit is contained in:
David Luzar 2020-12-22 11:00:51 +01:00 committed by GitHub
parent d7f314cda8
commit 8dfea49ec1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 11 deletions

View file

@ -7,6 +7,7 @@ import {
import { FontFamily, FontString } from "./element/types";
import { Zoom } from "./types";
import { unstable_batchedUpdates } from "react-dom";
import { isDarwin } from "./keys";
export const SVG_NS = "http://www.w3.org/2000/svg";
@ -179,15 +180,18 @@ export const allowFullScreen = () =>
export const exitFullScreen = () => document.exitFullscreen();
export const getShortcutKey = (shortcut: string): string => {
const isMac = /Mac|iPod|iPhone|iPad/.test(window.navigator.platform);
if (isMac) {
return `${shortcut
shortcut = shortcut
.replace(/\bAlt\b/i, "Alt")
.replace(/\bShift\b/i, "Shift")
.replace(/\b(Enter|Return)\b/i, "Enter")
.replace(/\bDel\b/i, "Delete");
if (isDarwin) {
return shortcut
.replace(/\bCtrlOrCmd\b/i, "Cmd")
.replace(/\bAlt\b/i, "Option")
.replace(/\bDel\b/i, "Delete")
.replace(/\b(Enter|Return)\b/i, "Enter")}`;
.replace(/\bAlt\b/i, "Option");
}
return `${shortcut.replace(/\bCtrlOrCmd\b/i, "Ctrl")}`;
return shortcut.replace(/\bCtrlOrCmd\b/i, "Ctrl");
};
export const viewportCoordsToSceneCoords = (