From c847eb5a8384111f560677346b8c2df5face236c Mon Sep 17 00:00:00 2001 From: Kirigaya <1193466151@qq.com> Date: Sun, 17 Nov 2024 22:46:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20orderTimes=20=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98=20|=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=82=B9=E5=87=BB=E6=B8=85=E9=99=A4=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E4=BF=A1=E6=A0=87=E5=90=8E=EF=BC=8C=E7=9B=B8=E5=AF=B9?= =?UTF-8?q?=E5=9D=90=E6=A0=87=E8=BD=B4=E4=B8=8D=E6=B6=88=E5=A4=B1=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/test.view | Bin 8009 -> 7886 bytes src/components/pivot/pivot-view.js | 3 +-- src/components/pivot/user-pivot.vue | 2 +- src/components/toolbar/cursor-location.vue | 5 +++++ src/hook/recover.js | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/public/test.view b/public/test.view index bc05745037ece2c3ed473b07d305c416f505c2b5..56934feb28800b890e357ae15a9b276d3a992405 100644 GIT binary patch delta 141 zcmX?Ucg~jSoZLpHSJI4)liy0q2|su`-GMP9H8VYp2zzTws6LV4-phA<)WVHlhnSf@q U6l9j=mlQLwGB9lZEE~oM0F5IrKL7v# delta 265 zcmX?Sd(w`{Q+^}UD{02c$#13Qgjb|3a$w9z%}mcIVE};(>Qg4m$++_hRQRW*6{nUk zWH2%?OfHjA7ZAwLNr^xf+$d8lrMkz*(6!ynfe|DboSc}G$^aFbY$vN#uf_>9lBFQC zEWf0fp##WfHej#=QUWEJxv311Ko(;K!=)&98NMo@Gcr>c7#!}4z1FOBV#-NOO3h(l z1FEpFRLCo4;3&?>FK1w6U^Zm1hZ|4?F<@f&i}{rgmO%_K@RxuaAd a < b); + orderedTimes.sort((a, b) => a - b); } export function searchOrderedTimeIndex(time) { @@ -163,7 +163,6 @@ export function getNearestUserPivot(time) { } const i = bisearch(orderedTimes, time); - // console.log(i, orderedTimes, time); if (i === pivotNum - 1) { return UserPivots.get(orderedTimes[i]); diff --git a/src/components/pivot/user-pivot.vue b/src/components/pivot/user-pivot.vue index dda75ce..7936bd4 100644 --- a/src/components/pivot/user-pivot.vue +++ b/src/components/pivot/user-pivot.vue @@ -197,7 +197,7 @@ function onVLineMouseup() { UserPivots.delete(vline.originTime); UserPivots.set(pivot.time, pivot); orderedTimes.push(pivot.time); - orderedTimes.sort((a, b) => a < b); + orderedTimes.sort((a, b) => a - b); } currentPivotId.value = 0; diff --git a/src/components/toolbar/cursor-location.vue b/src/components/toolbar/cursor-location.vue index 1977d55..c4c9779 100644 --- a/src/components/toolbar/cursor-location.vue +++ b/src/components/toolbar/cursor-location.vue @@ -107,6 +107,7 @@ import { clearAllPivot, makePivot, toBegin, toEnd, toNextChange, toPrevChange } import { globalLookup } from '@/hook/global'; import { SystemPivot } from '../pivot/cursor'; import { currentPivotId, Id2Pivot, orderedTimes, UserPivotCtxShows, UserPivots } from '../pivot/pivot-view'; +import { RelativeAxis } from '../pivot/relative-axis'; defineComponent({ name: 'cursor-location' }); @@ -116,11 +117,15 @@ const clearLocationDialogShow = ref(false); function confirmClearLocation() { orderedTimes.length === 0; + UserPivots.clear(); Id2Pivot.clear(); currentPivotId.value = 0; UserPivotCtxShows.clear(); + clearLocationDialogShow.value = false; + // 清除相对坐标轴(如果存在的话) + RelativeAxis.show = false; } diff --git a/src/hook/recover.js b/src/hook/recover.js index d945c69..0bdeacb 100644 --- a/src/hook/recover.js +++ b/src/hook/recover.js @@ -212,7 +212,7 @@ export function recoverSession(topModules) { Id2Pivot.set(id, pivot); orderedTimes.push(time); } - orderedTimes.sort((a, b) => a < b); + orderedTimes.sort((a, b) => a - b); } // 恢复 treeviewExpands