Skip to content

Commit

Permalink
Speed up the scrolling on Firefox Linux too
Browse files Browse the repository at this point in the history
(re: #5512)

This just changes
`detected.os === 'win'`  to  `detected.os !== 'mac'`
  • Loading branch information
bhousel committed Dec 12, 2018
1 parent 17615da commit d28b269
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/renderer/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ export function rendererMap(context) {
if (source.deltaMode === 1 /* LINE */) {
// Convert from lines to pixels, more if the user is scrolling fast.
// (I made up the exp function to roughly match Firefox to what Chrome does)
// These numbers should be floats, because integers are treated as pan gesture below.
var lines = Math.abs(source.deltaY);
var sign = (source.deltaY > 0) ? 1 : -1;
dY = sign * clamp(
Expand All @@ -439,10 +440,10 @@ export function rendererMap(context) {
350.000244140625 // max
);

// On Firefox/Windows we just always get +/- the scroll line amount (default 3)
// On Firefox Windows and Linux we always get +/- the scroll line amount (default 3)
// There doesn't seem to be any scroll accelleration.
// This multiplier increases the speed a little bit - #5512
if (detected.os === 'win') {
if (detected.os !== 'mac') {
dY *= 5;
}

Expand Down

0 comments on commit d28b269

Please sign in to comment.