We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents aa75140 + affe0be commit 07d5b98Copy full SHA for 07d5b98
src/dom/dom.js
@@ -3282,15 +3282,13 @@ p5.Element.prototype.size = function (w, h) {
3282
this.elt.width = aW;
3283
this.elt.height = aH;
3284
}
3285
-
3286
- this.width = this.elt.offsetWidth;
3287
- this.height = this.elt.offsetHeight;
3288
+ this.width = aW;
+ this.height = aH;
3289
if (this._pInst && this._pInst._curElement) {
3290
// main canvas associated with p5 instance
3291
if (this._pInst._curElement.elt === this.elt) {
3292
- this._pInst._setProperty('width', this.elt.offsetWidth);
3293
- this._pInst._setProperty('height', this.elt.offsetHeight);
+ this._pInst._setProperty('width', aW);
+ this._pInst._setProperty('height', aH);
3294
3295
3296
0 commit comments