diff --git a/lib/timeline/Range.js b/lib/timeline/Range.js index 704c68bd4e..e92dea2697 100644 --- a/lib/timeline/Range.js +++ b/lib/timeline/Range.js @@ -672,6 +672,7 @@ export default class Range extends Component { this.props.touch.end = this.end; this.props.touch.allowDragging = true; this.props.touch.center = null; + this.props.touch.centerDate = null; this.scaleOffset = 0; this.deltaDifference = 0; // Disable the browser default handling of this event. @@ -694,12 +695,12 @@ export default class Range extends Component { if (!this.props.touch.center) { this.props.touch.center = this.getPointer(event.center, this.body.dom.center); + this.props.touch.centerDate = this._pointerToDate(this.props.touch.center); } this.stopRolling(); - const scale = 1 / (event.scale + this.scaleOffset); - const centerDate = this._pointerToDate(this.props.touch.center); + const centerDate = this.props.touch.centerDate; const hiddenDuration = DateUtil.getHiddenDurationBetween(this.body.hiddenDates, this.start, this.end); const hiddenDurationBefore = DateUtil.getHiddenDurationBefore(this.options.moment, this.body.hiddenDates, this, centerDate); @@ -712,7 +713,7 @@ export default class Range extends Component { // snapping times away from hidden zones this.startToFront = 1 - scale <= 0; // used to do the right auto correction with periodic hidden times this.endToFront = scale - 1 <= 0; // used to do the right auto correction with periodic hidden times - + const safeStart = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newStart, 1 - scale, true); const safeEnd = DateUtil.snapAwayFromHidden(this.body.hiddenDates, newEnd, scale - 1, true); if (safeStart != newStart || safeEnd != newEnd) { @@ -722,7 +723,7 @@ export default class Range extends Component { newStart = safeStart; newEnd = safeEnd; } - + const options = { animation: false, byUser: true,