Skip to content

Commit

Permalink
trectangle: fix draw rects sometimes being inaccurate (fixup a30a627)
Browse files Browse the repository at this point in the history
Apparently, the manual rect calculations sometimes (eg, with the Progress Bar widget)
resulted in incorrectly placed rectangles being drawn. Using the bare dimension
values fixes this problem.
  • Loading branch information
Vultraz committed Mar 13, 2016
1 parent c37e9c4 commit c486e4b
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/gui/auxiliary/canvas.cpp
Expand Up @@ -808,12 +808,7 @@ void trectangle::draw(surface& canvas,

if(fill_color_) {

const unsigned left = x + border_thickness_;
const unsigned right = left + w - (2 * border_thickness_) - 1;
const unsigned top = y + border_thickness_;
const unsigned bottom = top + h - (2 * border_thickness_);

sdl::draw_solid_tinted_rectangle(left, top, right, bottom,
sdl::draw_solid_tinted_rectangle(x, y, w, h,
(fill_color_ & 0xFF000000) >> 24,
(fill_color_ & 0x00FF0000) >> 16,
(fill_color_ & 0x0000FF00) >> 8,
Expand Down

0 comments on commit c486e4b

Please sign in to comment.