Add error checking for blank _title string

This commit is contained in:
Tyler Perkins 2021-12-22 12:57:57 -05:00
parent ae85dae6e9
commit 23629bc4cf
1 changed files with 10 additions and 7 deletions

View File

@ -122,6 +122,8 @@ void def_overlay::update_texture() {
{ "Roboto_Mono/RobotoMono-Medium.ttf", 50 }), NULL, &tgt);
//show the current panel title (stored in _title)
//if its blank, dont show anything
if(!_title.empty()){
TTF_SizeText(board::getFont({ "Roboto_Mono/RobotoMono-Medium.ttf", 50 }),
_title.c_str(),
&tgt.w, &tgt.h);
@ -129,6 +131,7 @@ void def_overlay::update_texture() {
SDL_RenderCopy(board::getRenderer(),
board::getString(_title,
{ "Roboto_Mono/RobotoMono-Medium.ttf", 50 }), NULL, &tgt);
}