mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-23 16:24:06 +00:00
Overhaul node computeSize - use actual text width (#962)
### Node resize overhaul - Precisely calculates node minimum size - Prevents input & output overlap - Prevents (normal*) widgets from rendering text over the edge of nodes - Performance impact was sub-millisecond for normal usage in a 500-node graph  _Minimum size for a few example node configurations_ ### Widgets - Converts hard-coded draw render values to class static properties - Adds widget button draw function for left/right arrow widgets _*_ Exception: `control_after_generate`, as it is not a true input / widget. A check may be added later to handle this special case.
This commit is contained in:
@@ -26,7 +26,7 @@ export class TextWidget extends BaseWidget implements IStringWidget {
|
||||
y,
|
||||
width,
|
||||
show_text = true,
|
||||
margin = 15,
|
||||
margin = BaseWidget.margin,
|
||||
}: DrawWidgetOptions) {
|
||||
// Store original context attributes
|
||||
const originalTextAlign = ctx.textAlign
|
||||
|
||||
Reference in New Issue
Block a user