From fef13ebd196e0a61262bacb84a22184d1705162d Mon Sep 17 00:00:00 2001 From: Iskander Date: Mon, 19 Sep 2016 22:26:34 +0200 Subject: [PATCH] Added floating-point compensation to range-item width calculation (#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) {