aboutsummaryrefslogtreecommitdiffstatsci
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2017-11-04 17:58:48 +0100
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2017-11-04 17:58:48 +0100
commit1611f0aea0ec4e5d0239fb24c6db8897aace13c2 (patch)
treecb64075b0442a8da46467830a7a6feb5d490b620 /src
parent2b8c62055a7bc7a44df73965044b80c9cc572fe7 (diff)
slider debug when minimum is not 0
Diffstat (limited to 'src')
-rw-r--r--src/GraphicObjects/Slider.cs4
1 files 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);
}