From: Jean-Philippe Bruyère Date: Sat, 4 Nov 2017 16:58:48 +0000 (+0100) Subject: slider debug when minimum is not 0 X-Git-Tag: 0.6.0~19^2~2 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=3d35a311165ec94d6dd3be2f47179914f9119627;p=jp%2Fcrow.git slider debug when minimum is not 0 --- 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); }