From 3d35a311165ec94d6dd3be2f47179914f9119627 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Sat, 4 Nov 2017 17:58:48 +0100 Subject: [PATCH] slider debug when minimum is not 0 --- src/GraphicObjects/Slider.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/GraphicObjects/Slider.cs b/src/GraphicObjects/Slider.cs index 36f7e731..97c8b384 100644 --- a/src/GraphicObjects/Slider.cs +++ b/src/GraphicObjects/Slider.cs @@ -165,14 +165,14 @@ namespace Crow cursor = new Rectangle (new Size (_cursorSize, (int)(r.Height))); p1 = r.TopLeft + new Point (_cursorSize / 2, r.Height / 2); unity = (double)(r.Width - _cursorSize) / (Maximum - Minimum); - cursor.TopLeft = new Point (r.Left + (int)(Value * unity), + cursor.TopLeft = new Point (r.Left + (int)((Value - Minimum) * unity), (int)(p1.Y - cursor.Height / 2)); } else { cursor = new Rectangle (new Size ((int)(r.Width), _cursorSize)); p1 = r.TopLeft + new Point (r.Width / 2, _cursorSize / 2); unity = (double)(r.Height - _cursorSize) / (Maximum - Minimum); cursor.TopLeft = new Point ((int)(p1.X - r.Width / 2), - r.Top + (int)(Value * unity)); + r.Top + (int)((Value - Minimum) * unity)); } cursor.Inflate (-1); } -- 2.47.3