From d9576bee502314ec4686a505b51ba24d0d742388 Mon Sep 17 00:00:00 2001 From: Iskander508 Date: Tue, 20 Sep 2016 09:17:19 +0200 Subject: [PATCH] Added floating-point compensation to range-item width calculation (#2107) * fixes #2092 --- lib/timeline/component/item/RangeItem.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/timeline/component/item/RangeItem.js b/lib/timeline/component/item/RangeItem.js index f090f640b..01c94ed25 100644 --- a/lib/timeline/component/item/RangeItem.js +++ b/lib/timeline/component/item/RangeItem.js @@ -185,7 +185,9 @@ RangeItem.prototype.repositionX = function(limitSize) { end = 2 * parentWidth; } } - var boxWidth = Math.max(end - start, 1); + + // add 0.5 to compensate floating-point values rounding + var boxWidth = Math.max(end - start + 0.5, 1); if (this.overflow) { if (this.options.rtl) {