{
if (m->message == Message::MOUSE_LBDOWN)
{
- int x = m->parameter - getScreenX();
- int y = m->tag - getScreenY();
+ UINT x = m->parameter - getScreenX();
+ UINT y = m->tag - getScreenY();
if (!barShowing)
{
boxstack->handleCommand(Input::OK); //simulate rok press
}
- else if ((int)barRegion.x<=x && (int)barRegion.y<=y && ((int)barRegion.x+(int)barRegion.w)>=x
- && ((int)barRegion.y+(int)barRegion.h)>=y)
+ else if ( (barRegion.x <= x) // If the click happened within the bar region...
+ && (barRegion.y <= y)
+ && ((barRegion.x + barRegion.w) >= x)
+ && ((barRegion.y + barRegion.h) >= y))
{
- int progBarXbase = barRegion.x + 300;
- if (x>=(int)barRegion.x + progBarXbase + 24
- && x<=(int)barRegion.x + progBarXbase + 4 + 302
- && y>=(int)barRegion.y + 12 - 2
- && y<=(int)barRegion.y + 12 - 2+28)
+ UINT progBarXbase = barRegion.x + 300;
+ if ( x >= barRegion.x + progBarXbase + 24
+ && x <= barRegion.x + progBarXbase + 4 + 302
+ && y >= barRegion.y + 12 - 2
+ && y <= barRegion.y + 12 - 2+28)
{
- int cx=x-(barRegion.x + progBarXbase + 4);
- double percent=((double)cx)/302.*100.;
- player->jumpToPercent(percent);
+ int cx = x - (barRegion.x + progBarXbase + 4);
+ double percent = 100 * cx / 302.;
+ player->jumpToPercent(percent); // FIXME check this still works
doBar(3);
return;
// int progressWidth = 302 * currentFrameNum / lengthFrames;