[nit] Rename IDrawBoundingOptions args (#869)

This commit is contained in:
Chenlei Hu
2025-03-30 11:46:45 -04:00
committed by GitHub
parent 854ac4350f
commit 0eeaf90647
2 changed files with 9 additions and 9 deletions

View File

@@ -596,8 +596,8 @@ export class LGraphNode implements Positionable, IPinnable, IColorable {
if (this.has_errors) {
return {
padding: 12,
thickness: 10,
colour: LiteGraph.NODE_ERROR_COLOUR,
lineWidth: 10,
color: LiteGraph.NODE_ERROR_COLOUR,
}
}
}

View File

@@ -39,14 +39,14 @@ export interface IDrawBoundingOptions {
title_height?: number
/** @deprecated This is node-specific: it should be removed entirely, and behaviour defined by the caller more explicitly */
title_mode?: TitleMode
/** The colour that should be drawn */
colour?: CanvasColour
/** The color that should be drawn */
color?: CanvasColour
/** The distance between the edge of the {@link area} and the middle of the line */
padding?: number
/** @deprecated This is node-specific: it should be removed entirely, and behaviour defined by the caller more explicitly */
collapsed?: boolean
/** Thickness of the line drawn (`lineWidth`) */
thickness?: number
lineWidth?: number
}
/**
@@ -63,15 +63,15 @@ export function strokeShape(
round_radius,
title_height,
title_mode = TitleMode.NORMAL_TITLE,
colour,
color,
padding = 6,
collapsed = false,
thickness = 1,
lineWidth: thickness = 1,
}: IDrawBoundingOptions = {},
): void {
// These param defaults are not compile-time static, and must be re-evaluated at runtime
round_radius ??= LiteGraph.ROUND_RADIUS
colour ??= LiteGraph.NODE_BOX_OUTLINE_COLOR
color ??= LiteGraph.NODE_BOX_OUTLINE_COLOR
// Adjust area if title is transparent
if (title_mode === TitleMode.TRANSPARENT_TITLE) {
@@ -84,7 +84,7 @@ export function strokeShape(
const { lineWidth, strokeStyle } = ctx
ctx.lineWidth = thickness
ctx.globalAlpha = 0.8
ctx.strokeStyle = colour
ctx.strokeStyle = color
ctx.beginPath()
// Draw shape based on type