Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip out of canvas shapes for gridOutput() table #7135

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions src/accessibility/gridOutput.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,26 @@ function _gridMap(idT, ingredients) {
ingredients[x][y].color
} ${x} midpoint</a>`;
}
//if empty cell of location of shape is undefined
if (!cells[ingredients[x][y].loc.locY][ingredients[x][y].loc.locX]) {
//fill it with shape info
cells[ingredients[x][y].loc.locY][ingredients[x][y].loc.locX] = fill;
//if a shape is already in that location
} else {
//add it
cells[ingredients[x][y].loc.locY][ingredients[x][y].loc.locX] =
cells[ingredients[x][y].loc.locY][ingredients[x][y].loc.locX] +
' ' +
fill;

// Check if shape is in canvas, skip if not
if(
ingredients[x][y].loc.locY < cells.length &&
ingredients[x][y].loc.locX < cells[ingredients[x][y].loc.locY].length
){
//if empty cell of location of shape is undefined
if (!cells[ingredients[x][y].loc.locY][ingredients[x][y].loc.locX]) {
//fill it with shape info
cells[ingredients[x][y].loc.locY][ingredients[x][y].loc.locX] = fill;
//if a shape is already in that location
} else {
//add it
cells[ingredients[x][y].loc.locY][ingredients[x][y].loc.locX] =
cells[ingredients[x][y].loc.locY][ingredients[x][y].loc.locX] +
' ' +
fill;
}
shapeNumber++;
}
shapeNumber++;
}
}
//make table based on array
Expand Down
Loading