diff options
| author | bobzel <zzzman@gmail.com> | 2025-02-26 20:48:51 -0500 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2025-02-26 20:48:51 -0500 |
| commit | a9a1a6a507616a77f70d6525dab5027f5b7a60e6 (patch) | |
| tree | 97a37fdcdfed7bb2f0635b88b543ad525b58de14 /src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx | |
| parent | fa8122df7467af3d4410b7daf1cd75227a53fd96 (diff) | |
added typing to PostToServer calls. made smartDraw popup create images locally.
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx')
| -rw-r--r-- | src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index 3c31b584e..b33c267ee 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -1291,7 +1291,7 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection /** * Adds the created drawing to the freeform canvas and sets the metadata. */ - addDrawing = (doc: Doc, opts: DrawingOptions, gptRes: string) => { + addDrawing = (doc: Doc, opts: DrawingOptions, gptRes: string, x?: number, y?: number) => { const docData = doc[DocData]; docData.title = opts.text.match(/^(.*?)~~~.*$/)?.[1] || opts.text; docData._width = opts.size; @@ -1302,6 +1302,9 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection docData.ai_drawing_data = gptRes; docData.ai = 'gpt'; this._drawingContainer = doc; + if (x !== undefined && y !== undefined) { + [doc.x, doc.y] = this.screenToFreeformContentsXf.transformPoint(x, y); + } this.addDocument(doc); this._batch?.end(); }; |
