aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/ImageBox.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-02-26 21:41:50 -0500
committerbobzel <zzzman@gmail.com>2025-02-26 21:41:50 -0500
commit2a71391a44eddcc438a5b8ae7d7c2d873f8adcfc (patch)
treef0de4225a7d24c24bd8fc8a4972c2c8da38250d8 /src/client/views/nodes/ImageBox.tsx
parenta9a1a6a507616a77f70d6525dab5027f5b7a60e6 (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.tsx12
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>