From 663e1af4d997e7da95879f8c04ba048232ae19c3 Mon Sep 17 00:00:00 2001 From: Mitchell McCaffrey Date: Tue, 9 Feb 2021 14:43:32 +1100 Subject: [PATCH] Added max resolution to grid cache --- src/components/Grid.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Grid.js b/src/components/Grid.js index 998a759..81ec0db 100644 --- a/src/components/Grid.js +++ b/src/components/Grid.js @@ -27,7 +27,10 @@ function Grid({ strokeWidth, stroke }) { const gridRect = gridGroup.getClientRect(); if (gridRect.width > 0 && gridRect.height > 0) { // 150 pixels per grid cell - const maxMapSize = Math.max(grid.size.x, grid.size.y) * 150; + const maxMapSize = Math.min( + Math.max(grid.size.x, grid.size.y) * 150, + 7680 // Max 8K + ); const maxGridSize = Math.max(gridRect.width, gridRect.height) / debouncedStageScale; const maxPixelRatio = maxMapSize / maxGridSize;