From 2378be153da3e10e3f58793ea57ea09317db8c8b Mon Sep 17 00:00:00 2001 From: Bernd Hufmann Date: Wed, 20 Jan 2021 21:45:50 -0500 Subject: [PATCH] Don't scroll chart when all rows are visible Fixes #53 Signed-off-by: Bernd Hufmann --- timeline-chart/src/layer/time-graph-chart.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/timeline-chart/src/layer/time-graph-chart.ts b/timeline-chart/src/layer/time-graph-chart.ts index 61ef1b5..e280e2f 100644 --- a/timeline-chart/src/layer/time-graph-chart.ts +++ b/timeline-chart/src/layer/time-graph-chart.ts @@ -79,6 +79,9 @@ export class TimeGraphChart extends TimeGraphChartLayer { } const moveVertically = (magnitude: number) => { + if (this.rowController.totalHeight <= this.stateController.canvasDisplayHeight) { + return; + } let verticalOffset = Math.max(0, this.rowController.verticalOffset + magnitude); if (this.rowController.totalHeight - verticalOffset <= this.stateController.canvasDisplayHeight) { verticalOffset = this.rowController.totalHeight - this.stateController.canvasDisplayHeight;