diff options
| author | bobzel <zzzman@gmail.com> | 2023-11-01 15:38:22 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2023-11-01 15:38:22 -0400 |
| commit | 58213b0201ea0191f06f42beac9c3a17ebfc98ea (patch) | |
| tree | 293ad3cdf29b8d43b85cc841018611133fb70283 /src/client/views/collections/collectionFreeForm | |
| parent | e00122142a0e5960bd5c0ff2dfda5ea807eb5e2f (diff) | |
fixed so that ink properties can be set before drawing a stroke. fixed turning off ink when menu is collapsed. added meta-click to fit all for collections, or zoom in on a document.
Diffstat (limited to 'src/client/views/collections/collectionFreeForm')
| -rw-r--r-- | src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index 1e341f60d..a8b743896 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -312,6 +312,12 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection focus = (anchor: Doc, options: DocFocusOptions) => { if (this._lightboxDoc) return; + if (anchor === this.rootDoc) { + if (options.willZoomCentered && options.zoomScale) { + this.fitContentOnce(); + options.didMove = true; + } + } if (anchor.type !== DocumentType.CONFIG && !DocListCast(this.Document[this.fieldKey ?? Doc.LayoutFieldKey(this.Document)]).includes(anchor)) return; const xfToCollection = options?.docTransform ?? Transform.Identity(); const savedState = { panX: NumCast(this.Document[this.panXFieldKey]), panY: NumCast(this.Document[this.panYFieldKey]), scale: options?.willZoomCentered ? this.Document[this.scaleFieldKey] : undefined }; @@ -1620,15 +1626,6 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection () => this.isContentActive(), // if autoreset is on, then whenever the view is selected, it will be restored to it default pan/zoom positions active => !SnappingManager.GetIsDragging() && this.rootDoc[this.autoResetFieldKey] && active && this.resetView() ); - - this._disposers.fitContent = reaction( - () => this.rootDoc.fitContentOnce, - fitContentOnce => { - if (fitContentOnce) this.fitContentOnce(); - this.rootDoc.fitContentOnce = undefined; - }, - { fireImmediately: true, name: 'fitContent' } - ); }) ); } |
