mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-23 00:04:06 +00:00
[Refactor] Use litegraph LGraphNode.strokeStyles API (#3278)
This commit is contained in:
@@ -3,10 +3,9 @@ import {
|
||||
LGraphCanvas,
|
||||
LGraphEventMode,
|
||||
LGraphNode,
|
||||
LiteGraph,
|
||||
strokeShape
|
||||
LiteGraph
|
||||
} from '@comfyorg/litegraph'
|
||||
import type { IWidget, Rect, Vector2 } from '@comfyorg/litegraph'
|
||||
import type { IWidget, Vector2 } from '@comfyorg/litegraph'
|
||||
import _ from 'lodash'
|
||||
import type { ToastMessageOptions } from 'primevue/toast'
|
||||
import { reactive } from 'vue'
|
||||
@@ -572,41 +571,6 @@ export class ComfyApp {
|
||||
|
||||
const nodeErrors = self.lastNodeErrors?.[node.id]
|
||||
|
||||
let color = null
|
||||
let lineWidth = 1
|
||||
// @ts-expect-error fixme ts strict error
|
||||
if (node.id === +self.runningNodeId) {
|
||||
color = '#0f0'
|
||||
} else if (self.dragOverNode && node.id === self.dragOverNode.id) {
|
||||
color = 'dodgerblue'
|
||||
} else if (nodeErrors?.errors) {
|
||||
color = 'red'
|
||||
lineWidth = 2
|
||||
} else if (
|
||||
self.lastExecutionError &&
|
||||
// @ts-expect-error fixme ts strict error
|
||||
+self.lastExecutionError.node_id === node.id
|
||||
) {
|
||||
color = '#f0f'
|
||||
lineWidth = 2
|
||||
}
|
||||
|
||||
if (color) {
|
||||
const area: Rect = [
|
||||
0,
|
||||
-LiteGraph.NODE_TITLE_HEIGHT,
|
||||
size[0],
|
||||
size[1] + LiteGraph.NODE_TITLE_HEIGHT
|
||||
]
|
||||
strokeShape(ctx, area, {
|
||||
shape: node._shape || node.constructor.shape || LiteGraph.ROUND_SHAPE,
|
||||
thickness: lineWidth,
|
||||
colour: color,
|
||||
title_height: LiteGraph.NODE_TITLE_HEIGHT,
|
||||
collapsed: node.collapsed
|
||||
})
|
||||
}
|
||||
|
||||
// @ts-expect-error fixme ts strict error
|
||||
if (self.progress && node.id === +self.runningNodeId) {
|
||||
ctx.fillStyle = 'green'
|
||||
|
||||
Reference in New Issue
Block a user