summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2021-08-06 19:39:08 (EDT)
committer P. J. McDermott <pj@pehjota.net>2021-08-06 19:39:08 (EDT)
commit30928dc48de906abe73b67d53b77e5481b690501 (patch)
tree0e04fd838d5ac6daa5633cfad0df21fccc083a59 /src
parent67ec83b3a6a59567421ebec8bdbc985645fbba90 (diff)
downloadmazefight-30928dc48de906abe73b67d53b77e5481b690501.zip
mazefight-30928dc48de906abe73b67d53b77e5481b690501.tar.gz
mazefight-30928dc48de906abe73b67d53b77e5481b690501.tar.bz2
tk: Move text texture updating code
Diffstat (limited to 'src')
-rw-r--r--src/tk/text.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tk/text.c b/src/tk/text.c
index 5d61682..1a84a14 100644
--- a/src/tk/text.c
+++ b/src/tk/text.c
@@ -97,6 +97,8 @@ _mftk_text_key_event(struct mftk_widget *w, SDL_Event *e)
for (i = t->cur; i < len; ++i) {
t->val[i] = t->val[i + 1];
}
+ SDL_DestroyTexture(t->texture);
+ t->texture = NULL;
break;
case SDLK_DELETE:
len = strlen(t->val);
@@ -106,13 +108,12 @@ _mftk_text_key_event(struct mftk_widget *w, SDL_Event *e)
for (i = t->cur; i < len; ++i) {
t->val[i] = t->val[i + 1];
}
+ SDL_DestroyTexture(t->texture);
+ t->texture = NULL;
break;
default:
break;
}
- /* TODO */
- SDL_DestroyTexture(t->texture);
- t->texture = NULL;
break;
default:
break;