diff options
| author | bobzel <zzzman@gmail.com> | 2025-04-10 12:05:55 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2025-04-10 12:05:55 -0400 |
| commit | b0bb28202fa77556768d1da93bf9ea879c6ba2e5 (patch) | |
| tree | 85fbc30d8e82a87973d9aa2e8293d3012dc603f4 /src/client/views/collections/CollectionSubView.tsx | |
| parent | 2d382a1dd28aa5aae22669988475e5721435b738 (diff) | |
performance fixes for text boxes to not call screenToLocal unnecessarily. simplifications to template data docs
Diffstat (limited to 'src/client/views/collections/CollectionSubView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionSubView.tsx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx index a88707c6f..375c0fe53 100644 --- a/src/client/views/collections/CollectionSubView.tsx +++ b/src/client/views/collections/CollectionSubView.tsx @@ -603,7 +603,12 @@ export function CollectionSubView<X>() { */ @computed get uiBtnScaling() { return this.maxWidgetSize / this._sideBtnWidth; } // prettier-ignore - screenXPadding = () => (this.uiBtnScaling * this._sideBtnWidth - NumCast(this.layoutDoc.xMargin)) / this._props.ScreenToLocalTransform().Scale; + screenXPadding = (docView?: DocumentView) => { + if (!docView) return 0; + const diff = this._props.PanelWidth() - docView.PanelWidth(); + const xpad1 = this.uiBtnScaling * (this._sideBtnWidth - NumCast(this.layoutDoc.xMargin)) - diff / 2; // this._sideBtnWidth; + return xpad1 / (docView.NativeDimScaling?.() || 1); + }; filteredChildDocs = () => this.childLayoutPairs.map(pair => pair.layout); childDocsFunc = () => this.childDocs; @action setFilterFunc = (func?: (doc: Doc) => boolean) => { this._filterFunc = func; }; // prettier-ignore |
