Fix grid cell pixel size being set to Infinity
This commit is contained in:
parent
0bf911675c
commit
833f0082ba
@ -49,6 +49,9 @@ export function getGridPixelSize(grid, baseWidth, baseHeight) {
|
||||
* @returns {Size}
|
||||
*/
|
||||
export function getCellPixelSize(grid, gridWidth, gridHeight) {
|
||||
if (grid.size.x === 0 || grid.size.y === 0) {
|
||||
return new Size(0, 0);
|
||||
}
|
||||
switch (grid.type) {
|
||||
case "square":
|
||||
return new Size(gridWidth / grid.size.x, gridHeight / grid.size.y);
|
||||
|
Loading…
Reference in New Issue
Block a user