Add Recenter View menu option

This commit is contained in:
Skyler Lehmkuhl 2025-01-12 02:54:58 -05:00
parent 4eb30c5cb4
commit d4cb0513ca
1 changed files with 10 additions and 0 deletions

View File

@ -5244,6 +5244,10 @@ function zoomOut() {
} }
function resetZoom() { function resetZoom() {
context.zoomLevel = 1; context.zoomLevel = 1;
recenter()
}
function recenter() {
for (let canvas of canvases) { for (let canvas of canvases) {
canvas.offsetX = canvas.offsetY = 0; canvas.offsetX = canvas.offsetY = 0;
} }
@ -8108,6 +8112,12 @@ async function renderMenu() {
action: resetZoom, action: resetZoom,
accelerator: getShortcut("resetZoom"), accelerator: getShortcut("resetZoom"),
}, },
{
text: "Recenter View",
enabled: true,
action: recenter,
// accelerator: getShortcut("recenter"),
},
], ],
}); });
const helpSubmenu = await Submenu.new({ const helpSubmenu = await Submenu.new({