We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b963f16 commit 7e0c043Copy full SHA for 7e0c043
1 file changed
01_P/P_1_2_1_01/sketch.js
@@ -49,8 +49,8 @@ function setup() {
49
}
50
51
function draw() {
52
- tileCountX = int(map(mouseX, 0, width, 2, 100));
53
- tileCountY = int(map(mouseY, 0, height, 2, 10));
+ tileCountX = int(map(constrain(mouseX, 0, width), 0, width, 2, 100));
+ tileCountY = int(map(constrain(mouseY, 0, height), 0, height, 2, 10));
54
var tileWidth = width / tileCountX;
55
var tileHeight = height / tileCountY;
56
var interCol;
0 commit comments