Skip to content

Commit

Permalink
Don't scroll chart when all rows are visible
Browse files Browse the repository at this point in the history
Fixes #53

Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com>
  • Loading branch information
bhufmann committed Jan 21, 2021
1 parent f3e0d3a commit 2378be1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions timeline-chart/src/layer/time-graph-chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2378be1

Please sign in to comment.