fix(canvas): 放宽待连线取消方式
This commit is contained in:
@@ -216,6 +216,7 @@ function onPointerDown(e) {
|
|||||||
// 2) 点击连线:切换选中(不再落入平移)
|
// 2) 点击连线:切换选中(不再落入平移)
|
||||||
const edgeHit = e.target.closest?.('.cv-edge-hit')
|
const edgeHit = e.target.closest?.('.cv-edge-hit')
|
||||||
if (edgeHit && e.button === 0) {
|
if (edgeHit && e.button === 0) {
|
||||||
|
linkSource.value = null
|
||||||
const id = edgeHit.dataset.edgeId
|
const id = edgeHit.dataset.edgeId
|
||||||
const s = new Set(edgeSel.value)
|
const s = new Set(edgeSel.value)
|
||||||
if (s.has(id)) s.delete(id)
|
if (s.has(id)) s.delete(id)
|
||||||
@@ -226,7 +227,7 @@ function onPointerDown(e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const node = hitNode(e)
|
const node = hitNode(e)
|
||||||
if (!node) linkSource.value = null
|
if (!node || node.id === linkSource.value?.id) linkSource.value = null
|
||||||
const p = localXY(e)
|
const p = localXY(e)
|
||||||
|
|
||||||
const wantPan =
|
const wantPan =
|
||||||
@@ -355,7 +356,7 @@ function onPortClick(id, side) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (linkSource.value.id === id) {
|
if (linkSource.value.id === id) {
|
||||||
linkSource.value = linkSource.value.side === side ? null : { id, side }
|
linkSource.value = null
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
emit('link-create', {
|
emit('link-create', {
|
||||||
@@ -570,7 +571,7 @@ defineExpose({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="marquee" class="cv-marquee" :style="marquee" />
|
<div v-if="marquee" class="cv-marquee" :style="marquee" />
|
||||||
<div class="cv-hint">拖拽空白平移 · Ctrl+滚轮缩放 · 依次点击两个节点的连接点连线(Esc 取消) · 双击笔记编辑</div>
|
<div class="cv-hint">拖拽空白平移 · Ctrl+滚轮缩放 · 依次点击两个连接点连线(再点起点/空白/Esc 取消) · 双击笔记编辑</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -857,8 +857,8 @@ const saveLabel = computed(() => ({
|
|||||||
<div v-if="genMsg" class="cv-genmsg">{{ genMsg }}</div>
|
<div v-if="genMsg" class="cv-genmsg">{{ genMsg }}</div>
|
||||||
|
|
||||||
<div class="cv-tips">
|
<div class="cv-tips">
|
||||||
双击空白建笔记 · 依次点击两个连接点连线 · 选中后右下角缩放 · Ctrl+D 复制 ·
|
双击空白建笔记 · 依次点击两个连接点连线,再点起点/空白/Esc 取消 ·
|
||||||
本地图片直接拖入或 Ctrl+V 粘贴 · 按 1 适应全部内容
|
选中后右下角缩放 · Ctrl+D 复制 · 本地图片直接拖入或 Ctrl+V 粘贴 · 按 1 适应全部内容
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user