From f4d8435c592e7cd43a476a4e91af062fd12c21d7 Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Sat, 3 Jul 2021 09:06:13 -0500 Subject: [PATCH] verilog: waveform scroll left/right with wheel event --- src/ide/waveform.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ide/waveform.ts b/src/ide/waveform.ts index 3b339826..9536c2f3 100644 --- a/src/ide/waveform.ts +++ b/src/ide/waveform.ts @@ -137,6 +137,13 @@ export class WaveformView { down = false; //if (e['pointerId']) e.target.releasePointerCapture(e['pointerId']); }); + // scroll left/right + $(wlc).on('wheel', (event:any) => { + if (Math.abs(event.originalEvent.deltaX) > Math.abs(event.originalEvent.deltaY)) { + var xdelta = Math.max(-1000, Math.min(1000, event.originalEvent.deltaX)); + if (xdelta) this.setOrgTime(this.t0 + xdelta); + } + }); this.toolbar.add('=', 'Zoom In', 'glyphicon-zoom-in', (e,combo) => { this.setZoom(this.zoom * 2); });