Skip to content
This repository has been archived by the owner on Feb 10, 2023. It is now read-only.

Commit

Permalink
fix(core): initialize Size in ngOnInit instead
Browse files Browse the repository at this point in the history
  • Loading branch information
nartc committed Jun 23, 2021
1 parent faabbee commit 384556a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/core/src/lib/canvas.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ export class CanvasComponent implements OnInit, OnDestroy {
private readonly renderer: Renderer2,
@Inject(DOCUMENT) private readonly document: any,
private readonly destroyed: DestroyedService
) {
canvasStore.setSize({
width: hostElement.nativeElement.clientWidth,
height: hostElement.nativeElement.clientHeight,
});
}
) {}

ngOnInit(): void {
this.ngZone.runOutsideAngular(() => {
this.canvasStore.setSize({
width: this.hostElement.nativeElement.clientWidth,
height: this.hostElement.nativeElement.clientHeight,
});

this.canvasStore.setDpr(
(this.document as Document).defaultView?.devicePixelRatio || 1
);
Expand Down

0 comments on commit 384556a

Please sign in to comment.