文档内添加按钮拖拽提示

This commit is contained in:
Tenney
2024-09-11 16:21:05 +08:00
parent 8ae93ef599
commit dee55f2059
2 changed files with 7 additions and 4 deletions
+3 -1
View File
@@ -23,9 +23,11 @@ ComfyUI-NodeAligner is a lightweight ComfyUI layout plugin that includes feature
Click on the blank space to deselect.
4. 如果没选中任何节点的情况下,点击左对齐这画布返回“0、0”坐标。
If no nodes are selected, clicking left alignment will return the canvas to "0,0" coordinates.
5. 点中对齐按钮中间的黑色分割线可实现组件的拖拽,进行移动。
The black division line in the center of the right alignment button allows for component dragging and movement.
ps: 按住 Shift 进行拖拽可以对多个选择节点进行拖拽。
ps: 按住 Shift 进行拖拽可以对多个选择节点同时进行拖拽。
ps: Hold Shift to drag and move multiple selected nodes.
<img src="example.gif" width="800">
+4 -3
View File
@@ -58,11 +58,11 @@ const ButtonManager = {
background-color: #555555;
}
.divider {
width: 2.5px;
width: 3.2px;
height: 15px;
background-color: #262626;
margin: 5px 4px;
border-radius: 2.5px;
border-radius: 9px;
cursor: grab;
}
.divider:active {
@@ -392,10 +392,11 @@ function pollForCanvas() {
const canvas = document.querySelector('canvas#graph-canvas');
if (canvas) {
ButtonManager.show();
// 监听左键单击事件
canvas.addEventListener('click', function (event) {
event.preventDefault();
// console.log(event.target.data);
// console.log(event);
// 获取当前的 `LGraphCanvas` 数据
const current_node = event.target.data?.current_node;