Added some runtime protections. Fixed minor things.
This commit is contained in:
@@ -170,6 +170,11 @@ void WidgetText::set_color(SDL_Color text_color)
|
||||
|
||||
void WidgetText::draw()
|
||||
{
|
||||
if (nullptr == m_surface)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Clear surface
|
||||
SDL_FillRect(m_surface, nullptr, SDL_MapRGBA(m_surface->format, 255, 255, 255, SDL_ALPHA_TRANSPARENT));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user