public void OnLeftMove(ScreenPoint previousPosition, ScreenPoint currentPosition, ScreenPoint move, GameTime time)
{
//currentScrollPosition += (int)((move.Y / RelativeItemHeight)
// * ((float)minScrollPosition / (maxScrollPosition - pageScrollPosition)));
if (IsVisible && IsEnabled && HasScrollbar) {
//Bounds slider = ScrollSliderInBarBounds;
Bounds bar = ScrollBarBounds;
float percentOfBar = move.Relative.Y / bar.Size.Relative.Y;
currentScrollPosition += percentOfBar * maxScrollPosition;
/*
float maxValue = maxScrollPosition;
float pageValue = pageScrollPosition;
float visiblePercent = (pageValue / maxValue).Clamp (0.05f, 1f);
float sliderPosition = ScrollSliderInBarBounds.Position.Absolute.Y / ScrollBarBounds.Size.Absolute.Y;
Log.Debug ("sliderPosition=", sliderPosition, ", ScrollSliderInBarBounds=", ScrollSliderInBarBounds);
sliderPosition = move.Y / ScrollBarBounds.Size.Absolute.Y;
Log.Debug ("sliderPosition new=", sliderPosition, ", current.Y=", currentPosition.Y
+ ", bar.Size.Y=" + ScrollBarBounds.Size.Absolute.Y
);
currentScrollPosition = (int)(sliderPosition * (maxValue - pageValue));
*/
}
}