Skip to content

Commit

Permalink
Add constrain to address issue #175
Browse files Browse the repository at this point in the history
  • Loading branch information
Niels-NTG committed Jun 10, 2021
1 parent b963f16 commit 7e0c043
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 01_P/P_1_2_1_01/sketch.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ function setup() {
}

function draw() {
tileCountX = int(map(mouseX, 0, width, 2, 100));
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));
var tileWidth = width / tileCountX;
var tileHeight = height / tileCountY;
var interCol;
Expand Down

0 comments on commit 7e0c043

Please sign in to comment.