diff options
author | bobzel <zzzman@gmail.com> | 2023-04-24 12:08:52 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-04-24 12:08:52 -0400 |
commit | 24d4782be0d1160e073e0040d6926206cf465859 (patch) | |
tree | 4a55b0a54f6dc7e4c93b2c1ddc0b6ea900c4be95 | |
parent | 33299a19d86948051eef442825c0b3241d1ac619 (diff) |
fixed creating documents in a viewAll freeform view to not have degenerate scale/x/y coords
-rw-r--r-- | src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index 1fc4d9259..56bb2601f 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -141,7 +141,10 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection @computed get fitToContentVals() { return { bounds: { ...this.contentBounds, cx: (this.contentBounds.x + this.contentBounds.r) / 2, cy: (this.contentBounds.y + this.contentBounds.b) / 2 }, - scale: !this.childDocs.length ? 1 : Math.min(this.props.PanelHeight() / (this.contentBounds.b - this.contentBounds.y), this.props.PanelWidth() / (this.contentBounds.r - this.contentBounds.x)), + scale: + !this.childDocs.length || this.contentBounds.b === this.contentBounds.y || this.contentBounds.r - this.contentBounds.x + ? 1 + : Math.min(this.props.PanelHeight() / (this.contentBounds.b - this.contentBounds.y), this.props.PanelWidth() / (this.contentBounds.r - this.contentBounds.x)), }; } @computed get fitContentsToBox() { |