Skip to content

Commit

Permalink
Don't fail if passed multiple newlines as text
Browse files Browse the repository at this point in the history
Fixes #311

(cherry picked from commit 2089f48)
  • Loading branch information
slouken committed Jan 15, 2024
1 parent a0f5c67 commit 7da9d2a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/SDL_ttf.c
Original file line number Diff line number Diff line change
Expand Up @@ -3844,6 +3844,8 @@ static SDL_Surface* TTF_Render_Wrapped_Internal(TTF_Font *font, const char *text
}
}
}
/* In case there are all newlines */
width = SDL_max(width, 1);
}
} else {
if (numLines <= 1 && font->horizontal_align == TTF_WRAPPED_ALIGN_LEFT) {
Expand Down

0 comments on commit 7da9d2a

Please sign in to comment.