diff options
Diffstat (limited to 'src/client/views/smartdraw/SmartDrawHandler.tsx')
-rw-r--r-- | src/client/views/smartdraw/SmartDrawHandler.tsx | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/client/views/smartdraw/SmartDrawHandler.tsx b/src/client/views/smartdraw/SmartDrawHandler.tsx index 879358742..8271c0959 100644 --- a/src/client/views/smartdraw/SmartDrawHandler.tsx +++ b/src/client/views/smartdraw/SmartDrawHandler.tsx @@ -249,7 +249,7 @@ export class SmartDrawHandler extends ObservableReactComponent<object> { * Sends request to GPT API to recolor a selected ink document or group of ink documents. */ colorWithGPT = async (drawing: Doc) => { - const img = await this.getIcon(drawing); + const img = await DocumentView.GetDocImage(drawing); const { href } = ImageCast(img).url; const hrefParts = href.split('.'); const hrefComplete = `${hrefParts[0]}_o.${hrefParts[1]}`; @@ -286,18 +286,6 @@ export class SmartDrawHandler extends ObservableReactComponent<object> { }); }, 'color strokes'); - /** - * Gets an image snapshot of a doc. In this class, it's used to snapshot a selected ink stroke/group to use for GPT color. - */ - async getIcon(doc: Doc) { - const docView = DocumentView.getDocumentView(doc); - if (docView) { - docView.ComponentView?.updateIcon?.(); - return new Promise<ImageField | undefined>(res => setTimeout(() => res(ImageCast(docView.Document.icon)), 1000)); - } - return undefined; - } - renderDisplay() { return ( <div |