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 | |
| 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')
3 files changed, 7 insertions, 11 deletions
diff --git a/src/client/views/collections/CollectionTreeView.tsx b/src/client/views/collections/CollectionTreeView.tsx index 9e5ac77d9..e408c193a 100644 --- a/src/client/views/collections/CollectionTreeView.tsx +++ b/src/client/views/collections/CollectionTreeView.tsx @@ -98,8 +98,6 @@ export class CollectionTreeView extends CollectionSubView<Partial<collectionTree Object.values(this._disposers).forEach(disposer => disposer?.()); } - shrinkWrap = () => {}; // placeholder to allow setContentView to work - componentDidMount() { //this.props.setContentView?.(this); this._disposers.autoheight = reaction( 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' } - ); }) ); } diff --git a/src/client/views/collections/collectionLinear/CollectionLinearView.tsx b/src/client/views/collections/collectionLinear/CollectionLinearView.tsx index faf7501c4..9a2c79a22 100644 --- a/src/client/views/collections/collectionLinear/CollectionLinearView.tsx +++ b/src/client/views/collections/collectionLinear/CollectionLinearView.tsx @@ -215,6 +215,7 @@ export class CollectionLinearView extends CollectionSubView() { toggleStatus={BoolCast(this.layoutDoc.linearView_IsOpen)} onClick={() => { this.layoutDoc.linearView_IsOpen = !isExpanded; + ScriptCast(this.rootDoc.onClick)?.script.run({ this: this.rootDoc }, console.log); }} tooltip={isExpanded ? 'Close' : 'Open'} fillWidth={true} |
