From b4ee37165970ece07bad42f87078e5c8e20ae063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20Guill=C3=A9n=20i=20Pelegay?= Date: Tue, 19 May 2020 19:18:43 +0200 Subject: [PATCH] Fixing slider position for lower values --- src/morphic.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/morphic.js b/src/morphic.js index 49bb3f22..63411aee 100644 --- a/src/morphic.js +++ b/src/morphic.js @@ -6933,18 +6933,24 @@ SliderMorph.prototype.fixLayout = function () { bh = Math.max(bw, Math.round(this.height() * this.ratio())); this.button.setExtent(new Point(bw, bh)); posX = 1; - posY = Math.min( - Math.round((this.value - this.start) * this.unitSize()), - this.height() - this.button.height() + posY = Math.max( + Math.min( + Math.round((this.value - this.start) * this.unitSize()), + this.height() - this.button.height() + ), + 0 ); } else { bh = this.height() - 2; bw = Math.max(bh, Math.round(this.width() * this.ratio())); this.button.setExtent(new Point(bw, bh)); posY = 1; - posX = Math.min( - Math.round((this.value - this.start) * this.unitSize()), - this.width() - this.button.width() + posX = Math.max( + Math.min( + Math.round((this.value - this.start) * this.unitSize()), + this.width() - this.button.width() + ), + 0 ); } this.button.setPosition(