From 8995071f077b657547f0736c617111dc42917144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Wed, 16 Jul 2008 15:55:58 +0000 Subject: [PATCH] The vertical slider is now at least functionally working, although the rendering code needs some love. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26444 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Slider.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/kits/interface/Slider.cpp b/src/kits/interface/Slider.cpp index bb0f0fd02f..4d746539dd 100644 --- a/src/kits/interface/Slider.cpp +++ b/src/kits/interface/Slider.cpp @@ -687,9 +687,18 @@ BSlider::SetValue(int32 value) int32 BSlider::ValueForPoint(BPoint location) const { - float position = fOrientation == B_HORIZONTAL ? location.x : location.y; - float min = _MinPosition(); - float max = _MaxPosition(); + float min; + float max; + float position; + if (fOrientation == B_HORIZONTAL) { + min = _MinPosition(); + max = _MaxPosition(); + position = location.x; + } else { + max = _MinPosition(); + min = _MaxPosition(); + position = min + (max - location.y); + } if (position < min) position = min;