From b29321644b03df1b273d40c7d5895fa2ca329211 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Thu, 29 Oct 2020 13:50:17 +0200 Subject: TextBuf: Fixed garbage in the background --- src/ui/text.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/ui') diff --git a/src/ui/text.c b/src/ui/text.c index 7c39089d..4b3a5a10 100644 --- a/src/ui/text.c +++ b/src/ui/text.c @@ -1023,6 +1023,8 @@ void init_TextBuf(iTextBuf *d, int font, const char *text) { SDL_Texture *oldTarget = SDL_GetRenderTarget(render); SDL_SetRenderTarget(render, d->texture); SDL_SetTextureBlendMode(text_.cache, SDL_BLENDMODE_NONE); /* blended when TextBuf is drawn */ + SDL_SetRenderDrawColor(text_.render, 255, 255, 255, 0); + SDL_RenderClear(text_.render); draw_Text_(font, zero_I2(), white_ColorId, range_CStr(text)); SDL_SetTextureBlendMode(text_.cache, SDL_BLENDMODE_BLEND); SDL_SetRenderTarget(render, oldTarget); -- cgit v1.2.3