Skip to content

Commit 7ba0e37

Browse files
committed
fix to #8323
1 parent 809de6b commit 7ba0e37

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)