Skip to content

Commit ce3037d

Browse files
authored
Merge pull request #8324 from dhowe/fix-8323
Fixes 8323
2 parents 809de6b + ac4e6b3 commit ce3037d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/core/environment.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,11 @@ function environment(p5, fn, lifecycles){
319319
cursor = type;
320320
} else if (typeof type === 'string') {
321321
let coords = '';
322-
if (x && y && (typeof x === 'number' && typeof y === 'number')) {
322+
if (typeof x === 'number') { // fix for #8323
323+
y = typeof y === 'number' ? y : 0;
323324
// Note that x and y values must be unit-less positive integers < 32
324325
// https://developer.mozilla.org/en-US/docs/Web/CSS/cursor
325-
coords = `${x} ${y}`;
326+
coords = `${Math.max(x, 0)} ${Math.max(y, 0)}`;
326327
}
327328
if (
328329
type.substring(0, 7) === 'http://' ||

0 commit comments

Comments
 (0)