summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-06-14 21:49:16 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-06-15 14:04:22 +0300
commitf959fccf855af48cebf1cfae75c6938bba635e51 (patch)
tree265d4060935edb094308bb3549ae31a06509e4a9
parent916cb99d50e29a84404754050f5ebd601a0e4c92 (diff)
TextBuf: Attempted workaround
It is possible that calling `SDL_RenderClear` was not performing the expected clearing of the TextBuf texture due to the wrong blend mode being in effect. IssueID #271
-rw-r--r--src/ui/text.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ui/text.c b/src/ui/text.c
index 55fd4254..db922715 100644
--- a/src/ui/text.c
+++ b/src/ui/text.c
@@ -1504,9 +1504,10 @@ static void initWrap_TextBuf_(iTextBuf *d, int font, int color, int maxWidth, iB
1504 if (d->texture) { 1504 if (d->texture) {
1505 SDL_Texture *oldTarget = SDL_GetRenderTarget(render); 1505 SDL_Texture *oldTarget = SDL_GetRenderTarget(render);
1506 SDL_SetRenderTarget(render, d->texture); 1506 SDL_SetRenderTarget(render, d->texture);
1507 SDL_SetRenderDrawBlendMode(render, SDL_BLENDMODE_NONE);
1508 SDL_SetRenderDrawColor(render, 255, 255, 255, 0);
1509 SDL_RenderClear(render);
1507 SDL_SetTextureBlendMode(text_.cache, SDL_BLENDMODE_NONE); /* blended when TextBuf is drawn */ 1510 SDL_SetTextureBlendMode(text_.cache, SDL_BLENDMODE_NONE); /* blended when TextBuf is drawn */
1508 SDL_SetRenderDrawColor(text_.render, 0, 0, 0, 0);
1509 SDL_RenderClear(text_.render);
1510 const int fg = color | fillBackground_ColorId; 1511 const int fg = color | fillBackground_ColorId;
1511 iRangecc range = range_CStr(text); 1512 iRangecc range = range_CStr(text);
1512 if (maxWidth == 0) { 1513 if (maxWidth == 0) {