Anki/ts/image-occlusion/tools/tool-buttons.ts
Mani 5eafd82521
fix: ensure proper drawing of shape tools after pan/zoom (#3066)
* fix: ensure proper drawing of shape tools after pan/zoom

* remove sticky bottom toolbar

* make bounding-box not selectable after undo/redo

* fix: resize issue, added option to pan using alt/shift + mouse wheel

* drag with touchpad

* use isDesktop and move globalThis to index.ts

* gesture event not required, use preventDefault with passive false in wheel event

* use shift in mac and ctrl in pc
2024-03-16 14:05:51 +07:00

52 lines
1.3 KiB
TypeScript

// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import * as tr from "@tslib/ftl";
import {
mdiCursorDefaultOutline,
mdiEllipseOutline,
mdiRectangleOutline,
mdiTextBox,
mdiVectorPolygonVariant,
} from "../icons";
import {
cursorKeyCombination,
ellipseKeyCombination,
polygonKeyCombination,
rectangleKeyCombination,
textKeyCombination,
} from "./shortcuts";
export const tools = [
{
id: "cursor",
icon: mdiCursorDefaultOutline,
tooltip: tr.editingImageOcclusionSelectTool,
shortcut: cursorKeyCombination,
},
{
id: "draw-rectangle",
icon: mdiRectangleOutline,
tooltip: tr.editingImageOcclusionRectangleTool,
shortcut: rectangleKeyCombination,
},
{
id: "draw-ellipse",
icon: mdiEllipseOutline,
tooltip: tr.editingImageOcclusionEllipseTool,
shortcut: ellipseKeyCombination,
},
{
id: "draw-polygon",
icon: mdiVectorPolygonVariant,
tooltip: tr.editingImageOcclusionPolygonTool,
shortcut: polygonKeyCombination,
},
{
id: "draw-text",
icon: mdiTextBox,
tooltip: tr.editingImageOcclusionTextTool,
shortcut: textKeyCombination,
},
];