From bcb6e0ca01b859d7b06a424f81750ff1bd007194 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com⁩> Date: Mon, 9 Oct 2023 00:09:53 +0200 Subject: [PATCH] Slider: ask what the screens height is Should make this more likely to work on different size screens. --- modules/Slider.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/Slider.js b/modules/Slider.js index a88c91df2..69b3ef033 100644 --- a/modules/Slider.js +++ b/modules/Slider.js @@ -69,6 +69,7 @@ try { // For making it possiblie to run the test app in the following catch stat // Only add interactivity if wanted. if (o.c.dragableSlider) { + const Y_MAX = g.getHeight()-1; // Should this take users screen calibration into account? o.v.ebLast = 0; o.v.dy = 0; @@ -104,7 +105,7 @@ try { // For making it possiblie to run the test app in the following catch stat if (o.c.useMap && o.f.wasOnIndicator(exFirst)) { // If draging starts on the indicator, adjust one-to-one. let input = !o.c.horizontal? - Math.min((175-e.y)-o.c.yStart-3*o.c.rounded/4, o.c.height): + Math.min((Y_MAX-e.y)-o.c.yStart-3*o.c.rounded/4, o.c.height): Math.min(e.x-o.c.xStart-3*o.c.rounded/4, o.c.width); input = Math.round(input/o.c.STEP_SIZE);