@@ -465,4 +465,11 @@ import { h } from "../h"; | ||
| onclick: (e: MouseEvent) => { | ||
| let startPx = Math.min(this.lastX, this.endX); | ||
| let endPx = Math.max(this.lastX, this.endX); | ||
| const rect = this.timeline.getBoundingClientRect(); | ||
| let startPx = Math.min( | ||
| this.lastX - rect.left, | ||
| this.endX - rect.left | ||
| ); | ||
| let endPx = Math.max( | ||
| this.lastX - rect.left, | ||
| this.endX - rect.left | ||
| ); | ||
| const startTime = this.getTimeByPx(startPx); | ||
@@ -469,0 +476,0 @@ const endTime = this.getTimeByPx(endPx); |
+1
-1
| { | ||
| "name": "glibline", | ||
| "version": "0.0.10", | ||
| "version": "0.1.1", | ||
| "description": "时间轴(timeline),用于实现根据时间对数据事件操作。", | ||
@@ -5,0 +5,0 @@ "main": "index.ts", |
33626
0.73%889
0.79%