diff options
| author | Michael Foiani <sotech117@michaels-mbp-5.devices.brown.edu> | 2022-08-10 13:45:19 -0400 |
|---|---|---|
| committer | Michael Foiani <sotech117@michaels-mbp-5.devices.brown.edu> | 2022-08-10 13:45:19 -0400 |
| commit | f573b7a8e0764f6fdfec637810f6e5b699c33053 (patch) | |
| tree | 3a66fa34db31e83c95cc72cf13515f6c018b3a88 /src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx | |
| parent | 57a2713e1219b58e7ad08b697a23ea3f9b962a84 (diff) | |
| parent | a63f017c213563728f45f2caa7415843f50f3559 (diff) | |
Merge branch 'master' into report-bug-mfoiani
casual merge with master to keep local branch updated
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()) |
