Added fallback for token without size

This commit is contained in:
Mitchell McCaffrey
2021-01-03 16:46:22 +11:00
parent 852d5bce81
commit 037e4a4ab4
2 changed files with 2 additions and 2 deletions

View File

@@ -430,7 +430,7 @@ function MapFog({
// Constrain fog buffer to the map resolution
const fogRect = fogGroup.getClientRect();
const maxMapSize = Math.max(map.width, map.height);
const maxMapSize = map ? Math.max(map.width, map.height) : 4096; // Default to 4096
const maxFogSize =
Math.max(fogRect.width, fogRect.height) / debouncedStageScale;
const maxPixelRatio = maxMapSize / maxFogSize;