Skip to content

Commit

Permalink
Fix Vertical Scrollbar
Browse files Browse the repository at this point in the history
fixes #27

Signed-off-by: muddana-satish <satish.muddana@ericsson.com>
  • Loading branch information
muddana-satish authored and PatrickTasse committed Jul 12, 2021
1 parent 4ef0f9c commit 8689945
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions timeline-chart/src/layer/time-graph-vertical-scrollbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,9 @@ export class TimeGraphVerticalScrollbarHandle extends TimeGraphComponent<null> {
}, this._displayObject);
this.addEvent('mousemove', event => {
if (this.mouseIsDown) {
const delta = event.data.global.y - this.mouseStartY;
let ypos = this.oldVerticalOffset + delta;
if (ypos >= 0 && (ypos + this.height) <= this.stateController.canvasDisplayHeight) {
this.rowController.verticalOffset = ypos / this.factor;
}
const delta = (event.data.global.y - this.mouseStartY) / this.factor;
const verticalOffset = this.oldVerticalOffset + delta;
this.rowController.verticalOffset = Math.max(0, Math.min(this.rowController.totalHeight - this.stateController.canvasDisplayHeight, verticalOffset));
}
}, this._displayObject);
const moveEnd: TimeGraphInteractionHandler = event => {
Expand All @@ -73,7 +71,7 @@ export class TimeGraphVerticalScrollbarHandle extends TimeGraphComponent<null> {
this.addEvent('mouseupoutside', moveEnd, this._displayObject);
}

updateFactor(factor: number){
updateFactor(factor: number) {
this.factor = factor;
}

Expand Down

0 comments on commit 8689945

Please sign in to comment.