diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-06-14 21:49:16 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-06-14 21:49:16 +0300 |
commit | acad729245e09d927f1b16de2c6619b84f88c59e (patch) | |
tree | 280b1fdf000907f6543e4c8382cbcf224be6283c /src/ui | |
parent | fe238b29132b43f07aa88cf6bb60bec1ff0d3f8d (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
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/text.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ui/text.c b/src/ui/text.c index 8a2a9ff8..27be1bec 100644 --- a/src/ui/text.c +++ b/src/ui/text.c | |||
@@ -1506,9 +1506,10 @@ static void initWrap_TextBuf_(iTextBuf *d, int font, int color, int maxWidth, iB | |||
1506 | if (d->texture) { | 1506 | if (d->texture) { |
1507 | SDL_Texture *oldTarget = SDL_GetRenderTarget(render); | 1507 | SDL_Texture *oldTarget = SDL_GetRenderTarget(render); |
1508 | SDL_SetRenderTarget(render, d->texture); | 1508 | SDL_SetRenderTarget(render, d->texture); |
1509 | SDL_SetRenderDrawBlendMode(render, SDL_BLENDMODE_NONE); | ||
1510 | SDL_SetRenderDrawColor(render, 255, 255, 255, 0); | ||
1511 | SDL_RenderClear(render); | ||
1509 | SDL_SetTextureBlendMode(text_.cache, SDL_BLENDMODE_NONE); /* blended when TextBuf is drawn */ | 1512 | SDL_SetTextureBlendMode(text_.cache, SDL_BLENDMODE_NONE); /* blended when TextBuf is drawn */ |
1510 | SDL_SetRenderDrawColor(text_.render, 0, 0, 0, 0); | ||
1511 | SDL_RenderClear(text_.render); | ||
1512 | const int fg = color | fillBackground_ColorId; | 1513 | const int fg = color | fillBackground_ColorId; |
1513 | iRangecc range = range_CStr(text); | 1514 | iRangecc range = range_CStr(text); |
1514 | if (maxWidth == 0) { | 1515 | if (maxWidth == 0) { |