diff --git a/public/iconfont.css b/public/iconfont.css
index 1552658..159bf3b 100644
--- a/public/iconfont.css
+++ b/public/iconfont.css
@@ -1,6 +1,6 @@
@font-face {
font-family: "iconfont"; /* Project id 4440655 */
- src: url('iconfont.woff2?t=1725033317914') format('woff2');
+ src: url('iconfont.woff2?t=1725251353876') format('woff2');
}
.iconfont {
@@ -11,6 +11,10 @@
-moz-osx-font-smoothing: grayscale;
}
+.icon-clear:before {
+ content: "\e619";
+}
+
.icon-axis:before {
content: "\ed1f";
}
diff --git a/public/iconfont.woff2 b/public/iconfont.woff2
index 1e1f7fe..3ff238e 100644
Binary files a/public/iconfont.woff2 and b/public/iconfont.woff2 differ
diff --git a/src/components/about/index.vue b/src/components/about/index.vue
index c357714..3003ab2 100644
--- a/src/components/about/index.vue
+++ b/src/components/about/index.vue
@@ -49,7 +49,7 @@
diff --git a/src/components/pivot/axis-item.vue b/src/components/pivot/axis-item.vue
new file mode 100644
index 0000000..bddf0c2
--- /dev/null
+++ b/src/components/pivot/axis-item.vue
@@ -0,0 +1,38 @@
+
+
+ {{ props.pivot.label }}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/pivot/cursor.js b/src/components/pivot/cursor.js
index 37d4dec..6fdd593 100644
--- a/src/components/pivot/cursor.js
+++ b/src/components/pivot/cursor.js
@@ -32,7 +32,7 @@ export const SystemPivot = reactive({
this.label = formatTime(this.currentTime, timescale);
},
updateLeft() {
- this.left = calcCursorLeft(this.currentTime);
+ this.left = time2cursorX(this.currentTime);
}
});
@@ -46,20 +46,37 @@ export function changeCursorLocation() {
SystemPivot.show = true;
const pstate = globalLookup.pstate;
if (pstate) {
- const { xCursor, xOffset, xScale, tgcd, timescale } = pstate;
- const currentTime = Math.round((xCursor - xOffset) / xScale) * tgcd;
+ const { xCursor, timescale } = pstate;
+ const currentTime = cursorX2time(xCursor);
SystemPivot.currentTime = currentTime;
SystemPivot.updateLabel(timescale);
SystemPivot.updateLeft();
}
}
+
+/**
+ * @description 给出当前左侧偏移亮,计算出它实际上代表的时间
+ * @param {number} cursorX
+ * @returns {number}
+ */
+export function cursorX2time(cursorX) {
+ const pstate = globalLookup.pstate;
+ if (pstate) {
+ const { xOffset, xScale, tgcd } = pstate;
+ const currentTime = Math.round((cursorX - xOffset) / xScale) * tgcd;
+ return currentTime;
+ }
+
+ return 0;
+}
+
/**
* @description 给出当前的时间,比如 23ns,计算当前这个点应该相对于左侧偏移多少
* @param {number} currentTime
* @returns {number}
*/
-export function calcCursorLeft(currentTime) {
+export function time2cursorX(currentTime) {
const pstate = globalLookup.pstate;
if (pstate) {
const { xOffset, xScale, tgcd, timescale } = pstate;
diff --git a/src/components/pivot/index.vue b/src/components/pivot/index.vue
index 727d669..fda4593 100644
--- a/src/components/pivot/index.vue
+++ b/src/components/pivot/index.vue
@@ -24,6 +24,8 @@
/>
+
+
@@ -38,6 +40,7 @@ import Pivot from '@/components/pivot/system-pivot.vue';
import { globalLookup } from '@/hook/global';
import MovingPivotVue from './moving-pivot.vue';
import { UserPivotCtxShows } from './pivot-view';
+import RelativeAxis from './relative-axis.vue';
defineComponent({ name: 'main-render' });
@@ -45,10 +48,12 @@ defineComponent({ name: 'main-render' });
/**
* @description 渲染区域被鼠标点击时
*/
-function onMousedown() {
+function onMousedown() {
updateWireCurrentValue();
changeCursorLocation();
+ console.log('enter');
+
// 关闭所有
for (const id of UserPivotCtxShows.keys()) {
UserPivotCtxShows.set(id, false);
diff --git a/src/components/pivot/moving-pivot.vue b/src/components/pivot/moving-pivot.vue
index 9d8d5b2..a3a5864 100644
--- a/src/components/pivot/moving-pivot.vue
+++ b/src/components/pivot/moving-pivot.vue
@@ -21,7 +21,7 @@
import { emitter, globalLookup } from '@/hook/global';
import { eventHandler, registerWheelEvent } from '@/hook/wave-view';
import { computed, defineComponent, ref, onMounted } from 'vue';
-import { calcCursorLeft, MovingPivot } from './cursor';
+import { time2cursorX, MovingPivot, cursorX2time } from './cursor';
import formatTime from '@/hook/wave-view/format-time';
import { getNearestUserPivot, UserPivots } from './pivot-view';
@@ -54,12 +54,12 @@ function onMousemove(event) {
const pstate = globalLookup.pstate;
const x = event.clientX || event.x;
pstate.xCursor = x;
- const { xScale, xOffset, tgcd, timescale, xCursor } = pstate;
- const currentT = Math.round((xCursor - xOffset) / xScale) * tgcd;
+ const { timescale, xCursor } = pstate;
+ const currentT = cursorX2time(xCursor);
globalLookup.currentTime = currentT;
MovingPivot.currentTime = currentT;
MovingPivot.label = formatTime(currentT, timescale);
- MovingPivot.left = calcCursorLeft(currentT);
+ MovingPivot.left = time2cursorX(currentT);
const pivot = UserPivots.get(currentT);
if (pivot !== undefined) {
diff --git a/src/components/pivot/pivot-view.js b/src/components/pivot/pivot-view.js
index 2909835..f192bac 100644
--- a/src/components/pivot/pivot-view.js
+++ b/src/components/pivot/pivot-view.js
@@ -1,5 +1,5 @@
import { reactive, ref } from "vue";
-import { calcCursorLeft, SystemPivot } from "./cursor";
+import { time2cursorX, SystemPivot } from "./cursor";
import { globalLookup } from "@/hook/global";
import formatTime from "@/hook/wave-view/format-time";
@@ -16,9 +16,21 @@ import formatTime from "@/hook/wave-view/format-time";
/**
* @description 该数据结构描述了所有通过 makePivot 创建的 用户信标
- * @type {Map