Commit Graph

120 Commits

Author SHA1 Message Date
Chenlei Hu
63f9f30eec Implement NumberWidget (#481) 2025-02-08 15:45:23 -05:00
Chenlei Hu
c781053bd2 Implement ComboWidget (#480)
* wip

* Implement onClick
2025-02-08 15:16:15 -05:00
Chenlei Hu
fcc09c075d Implement BooleanWidget.onClick (#479) 2025-02-08 12:45:51 -05:00
Chenlei Hu
790aac89f0 [Refactor] Move drawSlot to NodeSlot (#477)
* [Refactor] Move drawSlot to NodeSlot

* nit
2025-02-07 18:06:25 -05:00
Chenlei Hu
608b5f8342 Implement NodeSlot (#476)
* Implement NodeSlot

* nit
2025-02-07 17:13:32 -05:00
Chenlei Hu
75f067dbb3 Implement BooleanWidget (#466)
* Implement BooleanWidget

* Merge function of addWidget

* Class conversion

* nit
2025-02-07 17:10:30 -05:00
filtered
c9f6b5ece8 [Refactor] Update style (#473)
* Update #471 to use Point convention

* Prefer camel case var names
2025-02-07 07:38:28 +11:00
Chenlei Hu
be03fcc7d1 Upstream drag zoom feature from ComfyUI_frontend (#471) 2025-02-06 14:36:02 -05:00
Chenlei Hu
316efd6666 Support override of paste position on LGraphCanvas.pasteFromClipboard (#468) 2025-02-05 16:33:52 -05:00
Chenlei Hu
c900df750e Simplify LGraphNode.onDrawBackground signature (#463) 2025-02-05 03:53:49 +11:00
Chenlei Hu
5acb656b15 [Refactor] Add LGraphCanvas.drawTitleText (#462) 2025-02-04 11:19:49 -05:00
Chenlei Hu
530fa874b0 [Refactor] Add LGraphNode.drawTitleBox (#461)
* [Refactor] Add LGraphNode.drawTitleBox

* nit
2025-02-04 10:57:50 -05:00
Chenlei Hu
7ea9a8405d [Reland][Refactor] Move node title background draw logic to LGraphNode (#459)
* [Refactor] Move node title background draw logic to LGraphNode (#452)

* Fix collapsed
2025-02-04 00:33:19 -05:00
Chenlei Hu
a3fa551a17 Remove unused LGraphCanvas.onMenuNodeToSubgraph (#457) 2025-02-03 23:39:28 -05:00
Chenlei Hu
dc24c6617f Revert "[Refactor] Move node title background draw logic to LGraphNode (#452)" (#455)
This reverts commit 047bf68dc9.
2025-02-03 23:34:46 -05:00
Chenlei Hu
f2fada0eab Remove LGraphCanvas._graph_stack (legacy subgraph) (#454) 2025-02-03 23:32:22 -05:00
Chenlei Hu
b3dbc41368 Remove LGraphNode.subgraph (Legacy subgraph) (#453)
* Remove LGraphNode.subgraph (Legacy subgraph)

* Update snapshot
2025-02-03 23:27:11 -05:00
Chenlei Hu
047bf68dc9 [Refactor] Move node title background draw logic to LGraphNode (#452) 2025-02-03 23:20:51 -05:00
Chenlei Hu
6cf1f2d627 [Refactor] Move shape fallback from LGraphCanvas to LGraphNode (#451)
* [Refactor] Move shape fallback from LGraphCanvas to LGraphNode

* nit
2025-02-03 23:02:42 -05:00
Chenlei Hu
0500d77665 Replace zoom scale check with low_quality flag check (#447)
* Replace zoom scale check with low_quality flag check

* nit
2025-02-03 20:07:27 -05:00
Chenlei Hu
1da2c8a914 [Refactor] Move node color fallback from LGraphCanvas to LGraphNode (#444)
* [Refactor] Move node color fallback from LGraphCanvas to LGraphNode

* nit
2025-02-03 16:51:01 -05:00
Chenlei Hu
4844311f3b Add ts-strict-ignore plugin (#443)
* Add ts-strict-ignore plugin

* nit
2025-02-03 15:49:58 -05:00
Chenlei Hu
0ee671843b Use consistent low_quality threshold in LGraphCanvas (#442)
* Use consistent low_quality threshold in LGraphCanvas

* Add LGraphCanvas.low_quality_zoom_threshold
2025-02-03 15:04:04 -05:00
Chenlei Hu
5ba6472c70 Remove LGraphCanvas.render_title_colored (#440)
* Remove LGraphCanvas.render_title_colored

* Simplify logic
2025-02-03 14:12:04 -05:00
Chenlei Hu
3e133b71e6 [Refactor] Add LGraphNode.title_mode (#439) 2025-02-03 13:57:14 -05:00
Chenlei Hu
817214e6da [Refactor] Move strokeShape from LGraphCanvas to draw (#435)
* [Refactor] Move strokeShape from LGraphCanvas to draw

* Fix round radius

* nit

* nit

* nit
2025-02-02 22:29:26 -05:00
Chenlei Hu
a4791f6e6b Remove unused LGraphCanvas.onConnectingChange (#434) 2025-01-30 15:40:55 -08:00
christian-byrne
b1f8afea2f fix nullish condition 2025-01-04 20:27:42 -05:00
bymyself
06b6da1353 Update src/LGraphCanvas.ts
Co-authored-by: filtered <176114999+webfiltered@users.noreply.github.com>
2025-01-04 20:27:42 -05:00
christian-byrne
6c037ca629 Fix dragging behavior in LGraphCanvas to depend on pointer state 2025-01-04 20:27:42 -05:00
filtered
a548a72f66 Fix selection box is always a square 2025-01-03 11:11:11 -05:00
filtered
c64c81882c Add workaround for Firefox pointer events (#412)
* Add workaround for Firefox pointer events

Co-Authored-By: catboxanon <122327233+catboxanon@users.noreply.github.com>

* nit

---------

Co-authored-by: catboxanon <122327233+catboxanon@users.noreply.github.com>
Co-authored-by: huchenlei <huchenlei@proton.me>
2025-01-01 19:34:58 -05:00
Chenlei Hu
edaf2933e1 Track LGraphState.draggingCanvas (#409)
* Track LGraphState.draggingCanvas

* nit
2024-12-30 00:20:01 -05:00
Chenlei Hu
7d77fceffa Properly update cursor style on mouse/keyboard events (#407)
* Properly update cursor style on mouse/keyboard events

* nit
2024-12-30 00:10:26 -05:00
Chenlei Hu
8856983597 Upstream cursor style (#405) 2024-12-29 23:39:23 -05:00
Chenlei Hu
54d7292d24 Stricter return value check on LGraphCanvas.getExtraMenuOptions (#401) 2024-12-27 13:51:31 -05:00
filtered
e6efff040d Resolve #395 - thick selection rectangle (#397) 2024-12-25 21:25:37 -05:00
bymyself
57dd8392db Don't process hidden links or reroutes (#396) 2024-12-25 21:25:15 -05:00
Chenlei Hu
11ce8e0f7b Fix NODE_DEFAULT_SHAPE (#389)
* Fix NODE_DEFAULT_SHAPE

* update snapshot
2024-12-23 20:04:32 -05:00
Chenlei Hu
e442732a09 Emit node-double-click event (#383)
* Emit node-double-click event

* nit
2024-12-19 16:37:29 -08:00
Chenlei Hu
7f0c3b02fb Fix slider value display when widget.label is present (#381) 2024-12-15 12:47:53 -08:00
Chenlei Hu
0048b5a0fe [i18n] Add INodeSlot.localized_name field (#376)
* [i18n] Add INodeSlot.localized_name field

* nit
2024-12-13 12:01:21 -08:00
filtered
1c1241bdb1 Optimise positionableItems / empty getters (#373)
* Optimise LGraph.empty() getter

* Optimise positionableItems getters

- No change to internal functionality
- Replaces forced spread of all items on every property access with generator function
- Consumers that require an array can very cleanly spread into one
2024-12-07 00:00:29 -05:00
Chenlei Hu
a9940da05f Add LGraph.empty (#371) 2024-12-06 17:49:50 -05:00
filtered
1238f83728 Prevent distortion of area select rectangle (#368) 2024-12-05 11:33:51 -05:00
filtered
8cda1ac48a Add CanvasPointer callback for node widgets (#363)
* Add CanvasPointer callback for node widgets

* Add API documentation

* nit - Docs
2024-12-01 20:31:48 -05:00
filtered
91077aa20b Redesign invalid node indicator (#358)
* nit

* Remove unused code

Gradient can (and should) be impl. directly by caching a CanvasGradient.

* nit

* nit - Refactor

* Remove redundant code

* Add line width & colour options to shape stroke

* Rename drawSelectionBounding to strokeShape

* nit - Doc

* Fix rounded corners not scaling with padding

* Optimise node badge draw

* Redesign invalid node visual indication

Customisable boundary indicator now used, replacing red background.

* Update snapshot

---------

Co-authored-by: huchenlei <huchenlei@proton.me>
2024-11-29 16:26:25 -05:00
filtered
24db9e2572 Add maximum FPS feature (#356) 2024-11-28 09:45:59 -05:00
filtered
304e229dc2 Fix custom widget pointerup receives NaN pos (#351) 2024-11-27 12:40:39 -05:00
filtered
f6e885f015 Ensure click_time is available to custom widgets (#349) 2024-11-26 13:05:47 -05:00