diff options
author | bobzel <zzzman@gmail.com> | 2025-02-26 21:41:50 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2025-02-26 21:41:50 -0500 |
commit | 2a71391a44eddcc438a5b8ae7d7c2d873f8adcfc (patch) | |
tree | f0de4225a7d24c24bd8fc8a4972c2c8da38250d8 /src/client/views/nodes/ImageBox.tsx | |
parent | a9a1a6a507616a77f70d6525dab5027f5b7a60e6 (diff) |
made regenerate ai show up next to image doc. show ai prompt for firefly in gptpopup .
Diffstat (limited to 'src/client/views/nodes/ImageBox.tsx')
-rw-r--r-- | src/client/views/nodes/ImageBox.tsx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx index 9395863d8..f3aea76a5 100644 --- a/src/client/views/nodes/ImageBox.tsx +++ b/src/client/views/nodes/ImageBox.tsx @@ -368,8 +368,13 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { this.layoutDoc.ai && funcs.push({ description: 'Regenerate AI Image', - event: action(e => { - !SmartDrawHandler.Instance.ShowRegenerate ? SmartDrawHandler.Instance.displayRegenerate(e?.x || 0, e?.y || 0) : SmartDrawHandler.Instance.hideRegenerate(); + event: action(() => { + if (!SmartDrawHandler.Instance.ShowRegenerate && this.DocumentView) { + const [x, y] = this.DocumentView().screenToViewTransform().inverse().transformPoint(NumCast(this.Document.width), 0); + this._props.docViewPath().slice(-2)[0]?.ComponentView?.showSmartDraw?.(x, y, true); + } else { + SmartDrawHandler.Instance.hideRegenerate(); + } }), icon: 'pen-to-square', }); @@ -625,7 +630,7 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { this._regenerateLoading = false; }) ); - } else + } else { SmartDrawHandler.Instance.regenerate([this.Document], undefined, undefined, this._regenInput || StrCast(this.Document.title), true).then( action(newImgs => { const firstImg = newImgs[0]; @@ -643,6 +648,7 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { } }) ); + } })} /> </div> |