修复 orderTimes 排序错误的问题 | 修复点击清除全部信标后,相对坐标轴不消失的问题
This commit is contained in:
parent
2fd8e87162
commit
c847eb5a83
BIN
public/test.view
BIN
public/test.view
Binary file not shown.
@ -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]);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user