Skip to content

Commit

Permalink
Merge pull request #762 from jonobr1/761-skia-canvas
Browse files Browse the repository at this point in the history
Fix constructor to match Skia Canvas spec
  • Loading branch information
jonobr1 authored Feb 13, 2025
2 parents b295cde + 9153f14 commit e18e95e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/two.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,10 @@ export default class Two {
_.extend(this.renderer.domElement.style, {
display: 'block',
});
} else if (!_.isElement(params.domElement)) {
} else if (
typeof params.width === 'number' &&
typeof params.height === 'number'
) {
this.renderer.setSize(params.width, params.height, this.ratio);
this.width = params.width;
this.height = params.height;
Expand Down

0 comments on commit e18e95e

Please sign in to comment.