Skip to content

Commit

Permalink
Improve reliability of locking to max zoom on line graph
Browse files Browse the repository at this point in the history
  • Loading branch information
jwbonner committed Dec 21, 2023
1 parent d915b90 commit 0d9ad24
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/hub/tabControllers/LineGraphController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,8 @@ export default class LineGraphController implements TabController {
}

// Apply vertical scroll
if (dy !== 0) {
if (dy !== 0 && (!this.maxZoom || dy < 0)) {
// If max zoom, ignore positive scroll (no effect, just apply the max zoom)
let zoomPercent = Math.pow(this.ZOOM_BASE, dy);
let newZoom = (this.timestampRange[1] - this.timestampRange[0]) * zoomPercent;
if (newZoom < this.MIN_ZOOM_TIME) newZoom = this.MIN_ZOOM_TIME;
Expand Down

0 comments on commit 0d9ad24

Please sign in to comment.