aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/collections/collectionFreeForm')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx5
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();
};