From 6b5462ec433d217ce0fb19d3e51fd86ce48bd031 Mon Sep 17 00:00:00 2001 From: Brad Hards Date: Sun, 26 Feb 2017 07:12:06 +1100 Subject: [PATCH] [Timeline] Modify redraw logic to treat scroll as needing restack. (#2774) This addresses #1982 and #1417. It possibly reduces performance, but correctness seems better. --- lib/timeline/component/ItemSet.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/timeline/component/ItemSet.js b/lib/timeline/component/ItemSet.js index 972db387..695602e8 100644 --- a/lib/timeline/component/ItemSet.js +++ b/lib/timeline/component/ItemSet.js @@ -616,8 +616,10 @@ ItemSet.prototype.redraw = function() { // TODO: would be nicer to get this as a trigger from Range var visibleInterval = range.end - range.start; var zoomed = (visibleInterval != this.lastVisibleInterval) || (this.props.width != this.props.lastWidth); - if (zoomed) this.stackDirty = true; + var scrolled = range.start != this.lastRangeStart; + if (zoomed || scrolled) this.stackDirty = true; this.lastVisibleInterval = visibleInterval; + this.lastRangeStart = range.start; this.props.lastWidth = this.props.width; var restack = this.stackDirty;