mirror of
https://github.com/tenrok/vue-ganttastic.git
synced 2026-06-19 04:10:32 +03:00
fix: incorrect pos of adding bar
This commit is contained in:
+3
-2
@@ -126,8 +126,9 @@ export default {
|
||||
onDoubleClick(e) {
|
||||
let barContainer = this.$refs.barContainer.getBoundingClientRect()
|
||||
let xPos = e.clientX - barContainer.left
|
||||
let timeDiffFromStart =
|
||||
Math.round(xPos / barContainer.width * this.getTimeCount())
|
||||
let timeDiffFromStart = Math.floor(
|
||||
(xPos / barContainer.width) * this.getTimeCount()
|
||||
)
|
||||
let time = moment(this.getChartStart()).add(
|
||||
timeDiffFromStart,
|
||||
this.timeUnit
|
||||
|
||||
Reference in New Issue
Block a user