From d7bec68fb202b01cadbd54cd561c727efdebff6f Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Wed, 2 Oct 2019 21:30:59 +0100 Subject: [PATCH] Reduce TTF line spacing to roughly match Diablo --- SourceX/DiabloUI/ttf_render_wrapped.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SourceX/DiabloUI/ttf_render_wrapped.cpp b/SourceX/DiabloUI/ttf_render_wrapped.cpp index 23c70c7a0..b54fab0c8 100644 --- a/SourceX/DiabloUI/ttf_render_wrapped.cpp +++ b/SourceX/DiabloUI/ttf_render_wrapped.cpp @@ -136,6 +136,8 @@ SDL_Surface *RenderUTF8_Solid_Wrapped(TTF_Font *font, const char *text, SDL_Colo SDL_SetColorKey(textbuf, SDL_TRUE, 0); #endif + // Reduced space between lines to roughly match Diablo. + const int lineskip = 0.7 * TTF_FontLineSkip(font); SDL_Rect dest = { 0, 0, 0, 0 }; for (std::size_t line = 0; line < numLines; line++) { text = strLines[line]; @@ -155,7 +157,7 @@ SDL_Surface *RenderUTF8_Solid_Wrapped(TTF_Font *font, const char *text, SDL_Colo break; } SDL_BlitSurface(tmp, nullptr, textbuf, &dest); - dest.y += tmp->h; + dest.y += lineskip; SDL_FreeSurface(tmp); } SDL_free(strLines);