GUI2 Canvas: Draw rectangle fill before border
This commit is contained in:
parent
f016ed96f4
commit
508a493736
1 changed files with 14 additions and 14 deletions
|
@ -792,20 +792,6 @@ void rectangle_shape::draw(surface& canvas,
|
|||
|
||||
surface_lock locker(canvas);
|
||||
|
||||
// Draw the border
|
||||
for(int i = 0; i < border_thickness_; ++i) {
|
||||
SDL_Rect dimensions {
|
||||
x + i,
|
||||
y + i,
|
||||
w - (i * 2),
|
||||
h - (i * 2)
|
||||
};
|
||||
|
||||
set_renderer_color(renderer, border_color_);
|
||||
|
||||
SDL_RenderDrawRect(renderer, &dimensions);
|
||||
}
|
||||
|
||||
// Fill the background, if applicable
|
||||
if(!fill_color_.null() && w && h) {
|
||||
set_renderer_color(renderer, fill_color_);
|
||||
|
@ -819,6 +805,20 @@ void rectangle_shape::draw(surface& canvas,
|
|||
|
||||
SDL_RenderFillRect(renderer, &area);
|
||||
}
|
||||
|
||||
// Draw the border
|
||||
for(int i = 0; i < border_thickness_; ++i) {
|
||||
SDL_Rect dimensions {
|
||||
x + i,
|
||||
y + i,
|
||||
w - (i * 2),
|
||||
h - (i * 2)
|
||||
};
|
||||
|
||||
set_renderer_color(renderer, border_color_);
|
||||
|
||||
SDL_RenderDrawRect(renderer, &dimensions);
|
||||
}
|
||||
}
|
||||
|
||||
/***** ***** ***** ***** ***** Rounded Rectangle ***** ***** ***** ***** *****/
|
||||
|
|
Loading…
Add table
Reference in a new issue