mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-20 14:54:12 +00:00
Fix buttons displayed behind images in litegraph (#7627)
#7394 caused a regression with preview image buttons showing behind the image in litegraph. This is fixed by also deferring button draws | Before | After | | ------ | ----- | | <img width="360" alt="before" src="https://github.com/user-attachments/assets/4c3b02e0-4951-403d-98b8-b01a01512d21"/> | <img width="360" alt="after" src="https://github.com/user-attachments/assets/7a4fb8e4-8caa-47f3-939d-8d8ddc0e71b4" />| --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -265,14 +265,19 @@ const renderPreview = (
|
||||
}
|
||||
}
|
||||
|
||||
ctx.fillStyle = fill
|
||||
ctx.beginPath()
|
||||
ctx.roundRect(x, y, sz, sz, [4])
|
||||
ctx.fill()
|
||||
ctx.fillStyle = textFill
|
||||
ctx.font = '12px Inter, sans-serif'
|
||||
ctx.textAlign = 'center'
|
||||
ctx.fillText(text, x + 15, y + 20)
|
||||
deferredImageRenders.push(() => {
|
||||
ctx.save()
|
||||
ctx.setTransform(transform)
|
||||
ctx.fillStyle = fill
|
||||
ctx.beginPath()
|
||||
ctx.roundRect(x, y, sz, sz, [4])
|
||||
ctx.fill()
|
||||
ctx.fillStyle = textFill
|
||||
ctx.font = '12px Inter, sans-serif'
|
||||
ctx.textAlign = 'center'
|
||||
ctx.fillText(text, x + 15, y + 20)
|
||||
ctx.restore()
|
||||
})
|
||||
|
||||
return isClicking
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user