Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const unsigned x = x_(variables);
- const unsigned y = y_(variables);
- const unsigned w = w_(variables);
- const unsigned h = h_(variables);
- DBG_GUI_D << "Rectangle: draw from " << x << ',' << y << " width " << w
- << " height " << h << " canvas size " << canvas->w << ','
- << canvas->h << ".\n";
- VALIDATE(static_cast<int>(x) < canvas->w
- && static_cast<int>(x + w) <= canvas->w
- && static_cast<int>(y) < canvas->h
- && static_cast<int>(y + h) <= canvas->h,
- _("Rectangle doesn't fit on canvas."));
- surface_lock locker(canvas);
- // draw the border
- for(unsigned 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);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement