Clean up UI type static_casts.

So disgusting, but not entirely gone yet...
This commit is contained in:
Jared Boone 2016-01-23 17:02:16 -08:00
parent 60b8b38652
commit ce481c0b5a
9 changed files with 45 additions and 62 deletions

View file

@ -326,19 +326,13 @@ void Button::paint(Painter& painter) {
painter.draw_rectangle(r, style().foreground);
painter.fill_rectangle(
{
static_cast<Coord>(r.pos.x + 1), static_cast<Coord>(r.pos.y + 1),
static_cast<Dim>(r.size.w - 2), static_cast<Dim>(r.size.h - 2)
},
{ r.pos.x + 1, r.pos.y + 1, r.size.w - 2, r.size.h - 2 },
paint_style.background
);
const auto label_r = paint_style.font.size_of(text_);
painter.draw_string(
{
static_cast<Coord>(r.pos.x + (r.size.w - label_r.w) / 2),
static_cast<Coord>(r.pos.y + (r.size.h - label_r.h) / 2)
},
{ r.pos.x + (r.size.w - label_r.w) / 2, r.pos.y + (r.size.h - label_r.h) / 2 },
paint_style,
text_
);