Skip to content

Commit

Permalink
feat: add home smoothing
Browse files Browse the repository at this point in the history
  • Loading branch information
rienheuver committed Oct 23, 2023
1 parent fc92112 commit d9c95b7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/classes/GroupingApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ export class GroupingApplication extends Application<HTMLCanvasElement> {
this.viewport.on("rightdown", this.rightclick, this);

this.stage.addChild(this.viewport);

window.addEventListener("load", () => {
this.resizeCanvas(this.screen.width, this.screen.height);
this.viewport.moveCenter(0, 0);
});
}

public addBlocks(blocks: Block[]) {
Expand Down Expand Up @@ -113,7 +118,11 @@ export class GroupingApplication extends Application<HTMLCanvasElement> {
}

public panToHome(): void {
this.viewport.moveCenter(0, 0);
this.viewport.animate({
removeOnInterrupt: true,
position: { x: 0, y: 0 },
time: 500,
});
}

public getLocations(): Point[] {
Expand Down

0 comments on commit d9c95b7

Please sign in to comment.