Comfy-Org / litegraph.js

A graph node engine and editor written in Javascript similar to PD or UDK Blueprints, comes with its own editor in HTML5 Canvas2D. The engine can run client side or server side using Node. It allows to export graphs as JSONs to be included in applications independently.
MIT License
52 stars 12 forks source link

Add pin icon to end of title #120

Closed huchenlei closed 2 months ago

huchenlei commented 2 months ago
  1. Pin icon is moved to the end of title.
  2. Pinned not cannot be expanded/collapsed.

image

christian-byrne commented 1 month ago

@huchenlei Do you think it's a good idea to use Primevue icon? Since the font is already loaded and the icons are mapped to unicode sequences.

              ctx.textAlign = "left";
              ctx.fillText(
                title,
                title_height,
                LiteGraph.NODE_TITLE_TEXT_Y - title_height
              );
              if (node22.pinned) {
                ctx.font = `${this.title_text_font.split(" ")[0]} PrimeIcons`
                ctx.fillText(
                  "\uea25",
                  title_height + ctx.measureText(title).width + 8,
                  LiteGraph.NODE_TITLE_TEXT_Y - title_height
                )
              }

Selection_312

Selection_313