From 30928dc48de906abe73b67d53b77e5481b690501 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 06 Aug 2021 19:39:08 -0400 Subject: tk: Move text texture updating code --- (limited to 'src/tk') 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; -- cgit v0.9.1