diff options
author | bobzel <zzzman@gmail.com> | 2025-07-16 13:03:12 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2025-07-16 13:03:12 -0400 |
commit | 3b0fca96e8350c4d103833a0cee6dcdc5e781d5c (patch) | |
tree | eed19ff01c263f9bf99c042efb00f19d16f7b9b3 /src/client/views/nodes/DocumentView.tsx | |
parent | a36a0aec384958778864f7842627f21a9fb31bf8 (diff) |
fixed placement of Docs on views that are modified as the result of the AI componentUI view being display
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index bd71115db..90edab3a7 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -743,6 +743,12 @@ export class DocumentViewInternal extends DocComponent<DocumentViewProps & Field widgetOverlayFunc = () => (this.widgetDecorations ? this.widgetOverlay : null); viewingAiEditor = () => (this._props.showAIEditor && this._componentView?.componentAIView?.() !== undefined ? this.aiEditor : null); @observable _contentsRef: DocumentContentsView | undefined = undefined; + screenToContentsXf = () => + this.viewingAiEditor() + ? this.layoutDoc.layout_reflowHorizontal + ? this._props.ScreenToLocalTransform().scale(Math.min(this.aiContentsWidth() / this._props.PanelWidth(), this.aiContentsHeight() / this._props.PanelHeight())) + : this._props.ScreenToLocalTransform().translate((this._props.PanelWidth() - this.aiContentsWidth()) / 2, 0) + : this._props.ScreenToLocalTransform(); @computed get viewBoxContents() { TraceMobx(); const isInk = this.layoutDoc._layout_isSvg && !this._props.LayoutTemplateString; @@ -762,6 +768,7 @@ export class DocumentViewInternal extends DocComponent<DocumentViewProps & Field layoutFieldKey={StrCast(this.Document.layout_fieldKey, 'layout')} pointerEvents={this.contentPointerEvents} setContentViewBox={this.setContentView} + ScreenToLocalTransform={this.screenToContentsXf} childFilters={this.childFilters} PanelWidth={this.viewingAiEditor() ? this.aiContentsWidth : this._props.PanelWidth} PanelHeight={this.viewingAiEditor() ? this.aiContentsHeight : this.panelHeight} |