Added throwDaping instance variable to fix throw behavior
This commit is contained in:
		
							parent
							
								
									b07d76ce1d
								
							
						
					
					
						commit
						06e69d86b6
					
				| @ -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) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user