GraphiteEditor / GraphiteEditor/Graphite

Edit->Duplicate in the node graph makes extra duplicates of reused input nodes

未关闭
#2,501 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Good First Issue
主要语言
Rust
星标
27.2k
派生
1.3k
平均合并
20 小时 5 分钟
30 天内合并 PR
57

描述

**Repro steps:**

1. Create a project with one Text node supplying input to two layers (or use the attached project).
2. Drag-select the two layers and their input nodes.
* In the attached project, use the bottom two layers, with the text "Shut up and take my money!"
3. Choose Edit -> Duplicate.
* It seems necessary to use the menu option, NOT the Ctrl-D keyboard shortcut, as odd as that sounds.

**Expected result:** The selected nodes are duplicated exactly once, adding two new layers.

**Observed result:** In _addition_ to the expected result, we now have one copy of the original Text node for each of the original two layers. This is almost impossible to notice since they overlap perfectly. See below for a more detailed explanation.

**Suggested fix:**
* Don't make extra copies of the re-used input nodes.
* For extra points, systemically prevent the case of nodes ever having exactly the same x and y coordinates in the node graph. When this happens it is REALLY confusing.

**Details:** In the attached project, I was attempting to create a "shadow" or outline for some meme text, using multiple layers. I reused the Text and Transform nodes for both layers using the node graph editor (see screenshot).

Later, I wanted a second line of text, so I box-selected my two layers and their input nodes and chose Edit -> Duplicate. This mostly worked, apart from some messed up wiring.

Even later, I tried to edit the top line of text and was confused as to why my edits were applying only to the white text and not the black text shadow:

![Image](https://github.com/user-attachments/assets/904f87c5-8d33-46a0-99dd-699a6133ac06)

Eventually I realised the topmost Text node is actually TWO Text nodes, perfectly overlapping so it's impossible to see. Here I've moved them slightly to demonstrate (note, the graph structure is identical to the above image):

![Image](https://github.com/user-attachments/assets/5f3b362d-a90b-4aab-a663-9cdfca864d2d)

I can reproduce this by similarly duplicating the bottom two layers with the text "Shut up and take my money".

[invalidate-cache.zip](https://github.com/user-attachments/files/19523590/invalidate-cache.zip)

贡献指南

这个仓库没有索引到贡献指南

调研方向

首先使用 invalidate-cache.zip 重现 Edit → Duplicate 操作,然后检查 node-graph 的复制入口,以及如何选择和复制重用的输入节点。确认复制选定图层不会创建共享输入节点的额外副本,并保留预期的连线;同时在重叠节点难以区分的图中验证结果。

由索引模型根据 Issue 内容生成。

评估

技术栈
rust
领域
computer-graphics, desktop
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。