From 6ac924c4c303392b92a88e36a8f7627cf3e3070f Mon Sep 17 00:00:00 2001 From: yotamberk Date: Sun, 29 Jan 2017 16:53:59 +0200 Subject: [PATCH] fix(timeline): Fix #2590 Min zoom bug (#2646) * Fix redraw order * Fix error when option is not defined * Allow template labels * Add .travis.yml file * Add experiment travis code * Fix react example * Fix zoom below 1ms bug --- lib/timeline/Range.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/timeline/Range.js b/lib/timeline/Range.js index e2ef0bbb..8b269d2e 100644 --- a/lib/timeline/Range.js +++ b/lib/timeline/Range.js @@ -342,7 +342,9 @@ Range.prototype._applyRange = function(start, end) { zoomMin = 0; } if ((newEnd - newStart) < zoomMin) { - if ((this.end - this.start) === zoomMin && newStart > this.start && newEnd < this.end) { + // compensate for a scale of 0.5 ms + var compensation = 0.5; + if ((this.end - this.start) === zoomMin && newStart >= this.start - compensation && newEnd <= this.end) { // ignore this action, we are already zoomed to the minimum newStart = this.start; newEnd = this.end;