From 92c5c2b486716393afbddc207406419c24b34383 Mon Sep 17 00:00:00 2001 From: Kirigaya <1193466151@qq.com> Date: Mon, 2 Sep 2024 19:25:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=A0=E9=99=A4=E6=89=80?= =?UTF-8?q?=E6=9C=89=E9=80=89=E6=8B=A9=E4=BF=A1=E5=8F=B7=E7=9A=84=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/pivot/moving-pivot.vue | 18 ++++++++---------- src/components/pivot/named-axis-item.vue | 1 - src/components/sidebar/handle-contextmenu.js | 16 ++++++++++++++++ src/components/sidebar/signal-context-menu.vue | 9 ++++++++- src/i18n/en.json | 1 + src/i18n/zh.json | 1 + 6 files changed, 34 insertions(+), 12 deletions(-) diff --git a/src/components/pivot/moving-pivot.vue b/src/components/pivot/moving-pivot.vue index 39ef005..d37d088 100644 --- a/src/components/pivot/moving-pivot.vue +++ b/src/components/pivot/moving-pivot.vue @@ -63,22 +63,20 @@ function onMousemove(event) { MovingPivot.label = formatTime(currentT, timescale); MovingPivot.left = time2cursorX(currentT); - const pivot = UserPivots.get(currentT); - if (pivot !== undefined) { - MovingPivot.show = false; - MovingPivot.currentTakenPivot = pivot; - return; - } + // const pivot = UserPivots.get(currentT); + // if (pivot !== undefined) { + // MovingPivot.show = false; + // MovingPivot.currentTakenPivot = pivot; + // return; + // } + - if (MovingPivot.currentTakenPivot !== undefined) { - return; - } // 通过计算距离最近的用户信标,来决定是否要消失,给与用户信标空间来执行额外操作 const userPivot = getNearestUserPivot(currentT); if (userPivot) { const marginX = Math.abs(x - userPivot.x); - if (marginX < 25) { + if (marginX < 12) { // 此时距离用户信标比较近,隐藏主信标 MovingPivot.show = false; MovingPivot.currentTakenPivot = userPivot; diff --git a/src/components/pivot/named-axis-item.vue b/src/components/pivot/named-axis-item.vue index 450ea4d..45700cb 100644 --- a/src/components/pivot/named-axis-item.vue +++ b/src/components/pivot/named-axis-item.vue @@ -39,7 +39,6 @@ const containerStyle = computed(() => ({ const itemStyle = computed(() => ({ left: getPivot().left - boxShift + 'px', - })); function getPivot() { diff --git a/src/components/sidebar/handle-contextmenu.js b/src/components/sidebar/handle-contextmenu.js index fd5f1f6..c4bd156 100644 --- a/src/components/sidebar/handle-contextmenu.js +++ b/src/components/sidebar/handle-contextmenu.js @@ -2,6 +2,7 @@ import { globalLookup } from "@/hook/global"; import { computed, nextTick, reactive } from "vue"; import { updateColorPickerManage } from "./color-picker"; import { WaveContainerView } from "@/hook/wave-container-view"; +import { sidebarSelectedWires } from "@/hook/sidebar-select-wire"; /** * @namespace contextmenu @@ -249,6 +250,21 @@ export function deleteSignalByView() { const signal = contextmenu.currentWire; if (signal) { WaveContainerView.delete(signal); + sidebarSelectedWires.delete(signal.link); + } + + contextmenu.show = false; +} + + +export function deleteAllSelectedSignals() { + + for (const link of globalLookup.sidebarSelectedWireLinks) { + const signal = globalLookup.link2CurrentWires.get(link); + if (signal) { + WaveContainerView.delete(signal); + sidebarSelectedWires.delete(link); + } } contextmenu.show = false; diff --git a/src/components/sidebar/signal-context-menu.vue b/src/components/sidebar/signal-context-menu.vue index b856b66..adea587 100644 --- a/src/components/sidebar/signal-context-menu.vue +++ b/src/components/sidebar/signal-context-menu.vue @@ -8,6 +8,13 @@
+