From 7c487402dab2bbffe9e72c3c5a60349d351f81fe Mon Sep 17 00:00:00 2001
From: Bob Zeleznik <zzzman@gmail.com>
Date: Sun, 2 Feb 2020 02:56:35 -0500
Subject: fixed template aliasing and expanding

---
 .../collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx')

diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx
index 6f84346df..2c694c329 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx
@@ -68,7 +68,7 @@ export function computePivotLayout(
     let numCols = NumCast(pivotDoc.pivotNumColumns, Math.ceil(Math.sqrt(minSize)));
     const docMap = new Map<Doc, ViewDefBounds>();
     const groupNames: PivotData[] = [];
-    numCols = Math.min(panelDim[0] / pivotAxisWidth, numCols);
+    numCols = Math.min(Math.max(1, panelDim[0] / pivotAxisWidth), numCols);
 
     const expander = 1.05;
     const gap = .15;
-- 
cgit v1.2.3-70-g09d2

