Compare commits

...

2 Commits

Author SHA1 Message Date
github-actions
b0e7883f25 [automated] Update test expectations 2025-12-23 22:46:53 +00:00
Terry Jia
2d7123fc6b fix: sync node.imgs on image load for VueNodes context menu 2025-12-23 15:49:54 -05:00
2 changed files with 12 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -198,6 +198,8 @@ const handleImageLoad = (event: Event) => {
if (img.naturalWidth && img.naturalHeight) {
actualDimensions.value = `${img.naturalWidth} x ${img.naturalHeight}`
}
syncNodeImgs()
}
const handleImageError = () => {
@@ -207,14 +209,21 @@ const handleImageError = () => {
actualDimensions.value = null
}
// In vueNodes mode, we need to set them manually before opening the mask editor.
const setupNodeForMaskEditor = () => {
// Sync node.imgs so context menu can detect this as an image node
const syncNodeImgs = () => {
if (!props.nodeId || !currentImageEl.value) return
const node = app.rootGraph?.getNodeById(props.nodeId)
if (!node) return
node.imageIndex = currentIndex.value
node.imgs = [currentImageEl.value]
app.canvas?.select(node)
}
// In vueNodes mode, we need to set them manually before opening the mask editor.
const setupNodeForMaskEditor = () => {
syncNodeImgs()
if (!props.nodeId) return
const node = app.rootGraph?.getNodeById(props.nodeId)
if (node) app.canvas?.select(node)
}
const handleEditMask = () => {