diff options
author | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2025-05-12 02:32:28 -0400 |
---|---|---|
committer | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2025-05-12 02:32:28 -0400 |
commit | 259aaed6bdb77872c40d5c1ea63af741eb52fd4c (patch) | |
tree | aaded987a8eff9d6163c7351b5545b44b75c8792 /src/client/views/smartdraw/DrawingFillHandler.tsx | |
parent | 5be235c8ca1b4ad5d499fac96133e77c773b7c6d (diff) |
styleref working hackily
Diffstat (limited to 'src/client/views/smartdraw/DrawingFillHandler.tsx')
-rw-r--r-- | src/client/views/smartdraw/DrawingFillHandler.tsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/views/smartdraw/DrawingFillHandler.tsx b/src/client/views/smartdraw/DrawingFillHandler.tsx index 48107ff0d..73a47681a 100644 --- a/src/client/views/smartdraw/DrawingFillHandler.tsx +++ b/src/client/views/smartdraw/DrawingFillHandler.tsx @@ -25,8 +25,8 @@ export class DrawingFillHandler { : [] : Doc.Links(drawing) .map(link => Doc.getOppositeAnchor(link, drawing)) - .map(anchor => anchor && DocCast(anchor.embedContainer)); - const styleUrl = await DocumentView.GetDocImage(styleDocs.filter(doc => doc?.data instanceof ImageField).lastElement())?.then(styleImg => { + .map(anchor => anchor && DocCast(anchor.embedContainer)); + const styyleUrl = await DocumentView.GetDocImage(styleDocs.lastElement())?.then(styleImg => { const hrefParts = ImageCast(styleImg).url.href.split('.'); return `${hrefParts.slice(0, -1).join('.')}_o.${hrefParts.lastElement()}`; }); @@ -42,6 +42,7 @@ export class DrawingFillHandler { const { href } = ImageCast(imageField).url; const hrefParts = href.split('.'); const structureUrl = `${hrefParts.slice(0, -1).join('.')}_o.${hrefParts.lastElement()}`; + const styleUrl = styleDoc ? `${hrefParts.slice(0, -1).join('.')}_o.${hrefParts.lastElement()}` : undefined; return imageUrlToBase64(structureUrl) .then(gptDescribeImage) .then((prompt, newPrompt = user_prompt || prompt) => |