mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-11 08:00:21 +00:00
Copy & Paste all items (#302)
* Add copy & paste of groups & reroutes Complete rewrite of copy & paste Fixes a bug where failure to clone a node would corrupt all subsequent nodes No longer mutates nodes when copying * Fix name collision * Fix cannot copy specified nodes to clipboard * Allow mapping of original IDs to pasted clones
This commit is contained in:
@@ -1265,7 +1265,9 @@ export class LGraph implements LinkNetwork, Serialisable<SerialisableGraph> {
|
||||
* @param linkIds IDs of links that pass through this reroute
|
||||
*/
|
||||
setReroute({ id, parentId, pos, linkIds }: SerialisableReroute): Reroute {
|
||||
id ??= ++this.state.lastRerouteId
|
||||
if (id > this.state.lastRerouteId) this.state.lastRerouteId = id
|
||||
|
||||
const reroute = this.reroutes.get(id) ?? new Reroute(id, this)
|
||||
reroute.update(parentId, pos, linkIds)
|
||||
this.reroutes.set(id, reroute)
|
||||
|
||||
Reference in New Issue
Block a user