[backport 1.25] show group self color in minimap (#4969)

Backport of #4954 to `core/1.25`

Automatically created by backport workflow.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-4969-backport-1-25-show-group-self-color-in-minimap-24e6d73d36508111b8f5ee86949b7144)
by [Unito](https://www.unito.io)

Co-authored-by: Terry Jia <terryjia88@gmail.com>
This commit is contained in:
Comfy Org PR Bot
2025-08-15 03:10:55 +08:00
committed by GitHub
parent f6967d889e
commit be4e5b0ade

View File

@@ -102,6 +102,9 @@ export function useMinimap() {
const groupColor = computed(() =>
isLightTheme.value ? '#A2D3EC' : '#1F547A'
)
const groupColorDefault = computed(
() => (isLightTheme.value ? '#283640' : '#B3C1CB') // this is the default group color when using nodeColors setting
)
const bypassColor = computed(() =>
isLightTheme.value ? '#DBDBDB' : '#4B184B'
)
@@ -249,7 +252,17 @@ export function useMinimap() {
const w = group.size[0] * scale.value
const h = group.size[1] * scale.value
ctx.fillStyle = groupColor.value
let color = groupColor.value
if (nodeColors.value) {
color = group.color ?? groupColorDefault.value
if (isLightTheme.value) {
color = adjustColor(color, { opacity: 0.5 })
}
}
ctx.fillStyle = color
ctx.fillRect(x, y, w, h)
}
}