Skip to content

Commit 34cadec

Browse files
committed
fix(pixi): canvas size
1 parent e869611 commit 34cadec

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/canvas-pixi/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ import '@nativescript/canvas-polyfill';
22
import * as Pixii from 'pixi.js';
33

44
export class TNSPIXIApplication extends Pixii.Application {
5-
constructor({canvas, ...props}) {
5+
constructor({ canvas, ...props }) {
66
(global as any).PIXI = (global as any).window.PIXI = (global as any).PIXI || Pixii;
77
super({
88
view: canvas,
9-
...props
9+
width: canvas.width || undefined,
10+
height: canvas.height || undefined,
11+
...props,
1012
});
1113
}
1214
}

0 commit comments

Comments
 (0)