value = ((xPos - trackRect.x) * (max - min) / len + min);
value = (xPos - trackRect.x) * (max - min) / len + min;
  int valueForXPosition(int xPos)  {    int min = scrollbar.getMinimum();    int max = scrollbar.getMaximum();    int len = trackRect.width;    int value;    // If the length is 0, you shouldn't be able to even see where the slider is.    // This really shouldn't ever happen, but just in case, we'll return the middle.    if (len == 0)      return ((max - min) / 2);    value = ((xPos - trackRect.x) * (max - min) / len + min);    // If this isn't a legal value, then we'll have to move to one now.    if (value > max)      value = max;    else if (value < min)      value = min;    return value;  }