Skip to content

Commit

Permalink
cells -> values; 1.4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
nakednous committed Sep 29, 2023
1 parent b2c44a5 commit cbe4f92
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions p5.quadrille.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ class Quadrille {
* @param {Object} params drawing params
*/
toImage(filename, {
cells,
values,
tileDisplay = Quadrille.TILE,
imageDisplay = Quadrille.IMAGE,
colorDisplay = Quadrille.COLOR,
Expand All @@ -494,7 +494,7 @@ class Quadrille {
cellLength ??= this._cellLength ? this._cellLength : Quadrille.CELL_LENGTH;
const graphics = createGraphics(this.width * cellLength, this.height * cellLength);
drawQuadrille(this, {
graphics, cells, tileDisplay, imageDisplay, colorDisplay, stringDisplay, numberDisplay,
graphics, values, tileDisplay, imageDisplay, colorDisplay, stringDisplay, numberDisplay,
arrayDisplay, objectDisplay, cellLength, outlineWeight, outline, textColor, textZoom
});
save(graphics, filename);
Expand Down Expand Up @@ -1219,7 +1219,7 @@ class Quadrille {
y,
row,
col,
cells,
values,
tileDisplay = Quadrille.TILE,
imageDisplay = Quadrille.IMAGE,
colorDisplay = Quadrille.COLOR,
Expand Down Expand Up @@ -1270,15 +1270,15 @@ class Quadrille {
tileDisplay(params);
}
graphics.pop();
}, cells);
}, values);
graphics.pop();
}

p5.prototype.visitQuadrille = function (quadrille, fx, cells) {
cells = new Set(cells);
p5.prototype.visitQuadrille = function (quadrille, fx, values) {
values = new Set(values);
for (let row = 0; row < quadrille.height; row++) {
for (let col = 0; col < quadrille.width; col++) {
if (cells.size ? cells.has(quadrille.read(row, col)) : true) {
if (values.size ? values.has(quadrille.read(row, col)) : true) {
fx(row, col);
}
}
Expand Down

0 comments on commit cbe4f92

Please sign in to comment.