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
This commit is contained in:
@@ -687,9 +687,18 @@ BSlider::SetValue(int32 value)
|
|||||||
int32
|
int32
|
||||||
BSlider::ValueForPoint(BPoint location) const
|
BSlider::ValueForPoint(BPoint location) const
|
||||||
{
|
{
|
||||||
float position = fOrientation == B_HORIZONTAL ? location.x : location.y;
|
float min;
|
||||||
float min = _MinPosition();
|
float max;
|
||||||
float max = _MaxPosition();
|
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)
|
if (position < min)
|
||||||
position = min;
|
position = min;
|
||||||
|
|||||||
Reference in New Issue
Block a user