Skip to content

Commit 6eb1302

Browse files
authored
Refactor origDimension assignment in screenToWorld
1 parent 3d38e07 commit 6eb1302

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/core/environment.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,8 +1314,8 @@ function environment(p5, fn, lifecycles){
13141314
*
13151315
*/
13161316
fn.screenToWorld = function(screenPosition) {
1317-
// remember how many components the caller actually provided to createVector
1318-
const origDimension = this.dimension;
1317+
let origDimension = screenPosition._origDimension;
1318+
13191319
const screenToWorldArgs = arguments.length;
13201320
if (typeof screenPosition === 'number') {
13211321
// We got passed numbers, convert to vector
@@ -1334,6 +1334,7 @@ function environment(p5, fn, lifecycles){
13341334
return matrixInverse.multiplyAndNormalizePoint(screenPosition);
13351335
};
13361336

1337+
13371338
/**
13381339
* A `Number` variable that stores the width of the canvas in pixels.
13391340
*

0 commit comments

Comments
 (0)