diff --git a/public/test.view b/public/test.view index bc05745..56934fe 100644 Binary files a/public/test.view and b/public/test.view differ diff --git a/src/components/pivot/pivot-view.js b/src/components/pivot/pivot-view.js index eb100d2..da444b1 100644 --- a/src/components/pivot/pivot-view.js +++ b/src/components/pivot/pivot-view.js @@ -56,7 +56,7 @@ export function createPivot(time) { Id2Pivot.set(id, pivot); orderedTimes.push(time); - orderedTimes.sort((a, b) => 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