From 8532d9048e4aed184030580f774d516ff5db2059 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Fri, 17 Jun 2022 19:42:05 +0200 Subject: [PATCH] process high-resolution scroll events for the frequency display --- htdocs/lib/FrequencyDisplay.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/lib/FrequencyDisplay.js b/htdocs/lib/FrequencyDisplay.js index b24ebca..7aeecc7 100644 --- a/htdocs/lib/FrequencyDisplay.js +++ b/htdocs/lib/FrequencyDisplay.js @@ -98,8 +98,13 @@ TuneableFrequencyDisplay.prototype.setupEvents = function() { if (index < 0) return; var delta = 10 ** (Math.floor(Math.max(me.exponent, Math.log10(me.frequency))) - index); - if (e.originalEvent.deltaY > 0) delta *= -1; - var newFrequency = me.frequency + delta; + var newFrequency; + if ('deltaMode' in e.originalEvent && e.originalEvent.deltaMode === 0) { + newFrequency = me.frequency - delta * (e.originalEvent.deltaY / 50); + } else { + if (e.originalEvent.deltaY > 0) delta *= -1; + newFrequency = me.frequency + delta; + } me.element.trigger('frequencychange', newFrequency); });