Add Recenter View menu option
This commit is contained in:
+10
@@ -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({
|
||||||
|
|||||||
Reference in New Issue
Block a user