C-style cast cleanup.

This commit is contained in:
Mark de Wever 2007-08-27 19:10:55 +00:00
parent 5e76a98b5d
commit a342251f90

View file

@ -201,10 +201,10 @@ SDL_Rect scrollbar::grip_area() const
SDL_Rect const &loc = groove_area();
if (full_height_ == grip_height_)
return loc;
int h = (int)loc.h * grip_height_ / full_height_;
int h = static_cast<int>(loc.h) * grip_height_ / full_height_;
if (h < minimum_grip_height_)
h = minimum_grip_height_;
int y = loc.y + ((int)loc.h - h) * grip_position_ / (full_height_ - grip_height_);
int y = loc.y + (static_cast<int>(loc.h) - h) * grip_position_ / (full_height_ - grip_height_);
SDL_Rect res = { loc.x, y, loc.w, h };
return res;
}
@ -325,7 +325,8 @@ void scrollbar::handle_event(const SDL_Event& event)
new_state = on_grip ? ACTIVE : NORMAL;
} else if (state_ == DRAGGED && groove.h != grip.h) {
int y_dep = e.y - grip.y - mousey_on_grip_;
int dep = y_dep * int(full_height_ - grip_height_) / (int)(groove.h - grip.h);
int dep = y_dep * static_cast<int>(full_height_ - grip_height_) /
static_cast<int>(groove.h - grip.h);
move_position(dep);
}
break;