Skip to content

Commit

Permalink
Add "Zoom to fit waypoints" keyboard shortcut (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
Awesomeplayer165 committed Feb 29, 2024
1 parent 8606219 commit 114b127
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Empty file added .fleet/run.json
Empty file.
7 changes: 7 additions & 0 deletions src/document/DocumentManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,13 @@ export class DocumentManager {
hotkeys("command+n,ctrl+n", { keydown: true }, () => {
this.newFile();
});
hotkeys("command+0,ctrl+0", () => {
if (this.model.document.pathlist.activePath.waypoints.length == 0) {
toast.error("No waypoints to zoom to");
} else {
this.model.zoomToFitWaypoints();
}
});
hotkeys("right,x", () => {
const waypoints = this.model.document.pathlist.activePath.waypoints;
const selected = waypoints.find((w) => {
Expand Down

0 comments on commit 114b127

Please sign in to comment.