From 06e69d86b66951446715dd2a5ffd8ca05fbeb914 Mon Sep 17 00:00:00 2001 From: Uwe Oestermeier Date: Tue, 14 May 2019 09:57:28 +0200 Subject: [PATCH] Added throwDaping instance variable to fix throw behavior --- lib/pixi/timeline.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/pixi/timeline.js b/lib/pixi/timeline.js index d0f5ac2..cf2386a 100644 --- a/lib/pixi/timeline.js +++ b/lib/pixi/timeline.js @@ -476,7 +476,7 @@ export class ColorRanges { export default class Timeline extends BitmapLabeledGraphics { constructor(width, height, { ticks = null, - baseLine = 0.5, showRange = true } = {}) { + baseLine = 0.5, showRange = true, throwDamping = 0.95 } = {}) { super() this.wantedWidth = width this.wantedHeight = height @@ -507,6 +507,7 @@ export default class Timeline extends BitmapLabeledGraphics { this.selection = null this.autoScroll = false this.direction = -1 + this.throwDamping = throwDamping this.timeticks = ticks || new TimeTicks(new DecadeTicks(), new YearTicks(), new MonthTicks(), @@ -884,7 +885,7 @@ export default class Timeline extends BitmapLabeledGraphics { return } this.scroll += delta - delta *= 0.985 + delta *= this.throwDamping this.redraw() if (Math.abs(delta) > 1 && this.autoScroll) { setTimeout(() => this.keepInBounds(delta, anchor), 1000 / 100)