| 65 | } |
| 66 | |
| 67 | void Label::drawCentered(const int x, const int y) const { |
| 68 | if (!_texture || _text.empty()) |
| 69 | return; |
| 70 | |
| 71 | const auto renderer = Singletons::getRendererProvider().getRenderer(); |
| 72 | const SDL_Rect rect{x - _width / 2, y - _height / 2, _width, _height}; |
| 73 | SDL_RenderCopy(renderer, _texture.get(), nullptr, &rect); |
| 74 | } |
| 75 | |
| 76 | } // namespace Abyss::UI |
no test coverage detected