Add Recenter View menu option
This commit is contained in:
parent
4eb30c5cb4
commit
d4cb0513ca
10
src/main.js
10
src/main.js
|
|
@ -5244,6 +5244,10 @@ function zoomOut() {
|
|||
}
|
||||
function resetZoom() {
|
||||
context.zoomLevel = 1;
|
||||
recenter()
|
||||
}
|
||||
|
||||
function recenter() {
|
||||
for (let canvas of canvases) {
|
||||
canvas.offsetX = canvas.offsetY = 0;
|
||||
}
|
||||
|
|
@ -8108,6 +8112,12 @@ async function renderMenu() {
|
|||
action: resetZoom,
|
||||
accelerator: getShortcut("resetZoom"),
|
||||
},
|
||||
{
|
||||
text: "Recenter View",
|
||||
enabled: true,
|
||||
action: recenter,
|
||||
// accelerator: getShortcut("recenter"),
|
||||
},
|
||||
],
|
||||
});
|
||||
const helpSubmenu = await Submenu.new({
|
||||
|
|
|
|||
Loading…
Reference in New Issue