diff options
| author | mehekj <mehek.jethani@gmail.com> | 2022-08-11 13:09:11 -0400 |
|---|---|---|
| committer | mehekj <mehek.jethani@gmail.com> | 2022-08-11 13:09:11 -0400 |
| commit | e611aa3096a9eda6ac94e20c86f263d338533d49 (patch) | |
| tree | 2737d472b15e88e2f5640358a21b7a95071d3d99 /src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx | |
| parent | 5c4b22b50e4693419daac777669b258b155f6ea9 (diff) | |
| parent | 3c08d65a63e04d421954193742a49d539b842c20 (diff) | |
Merge branch 'master' into schema-mehek
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx')
| -rw-r--r-- | src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx index a0ebe4cdc..3d85d32a0 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx @@ -393,8 +393,10 @@ function normalizeResults( 0 ); aggBounds.r = aggBounds.x + Math.max(minWidth, aggBounds.r - aggBounds.x); - const wscale = panelDim[0] / (aggBounds.r - aggBounds.x); - let scale = wscale * (aggBounds.b - aggBounds.y) > panelDim[1] ? panelDim[1] / (aggBounds.b - aggBounds.y) : wscale; + const width = aggBounds.r - aggBounds.x === 0 ? 1 : aggBounds.r - aggBounds.x; + const height = aggBounds.b - aggBounds.y === 0 ? 1 : aggBounds.b - aggBounds.y; + const wscale = panelDim[0] / width; + let scale = wscale * height > panelDim[1] ? panelDim[1] / height : wscale; if (Number.isNaN(scale)) scale = 1; Array.from(docMap.entries()) |
