summaryrefslogtreecommitdiffstats
path: root/src/tk/text.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tk/text.c')
-rw-r--r--src/tk/text.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/tk/text.c b/src/tk/text.c
index 6bac6e7..052beeb 100644
--- a/src/tk/text.c
+++ b/src/tk/text.c
@@ -139,8 +139,6 @@ _mftk_text_render(struct mftk_widget *w, SDL_Renderer *renderer, int x, int y)
t->color->r, t->color->g,
t->color->b, t->color->a) < 0 ||
SDL_RenderDrawLine(renderer,
- x + cur_x, y + t->y, x + cur_x, y + t->h) < 0 ||
- SDL_RenderDrawLine(renderer,
x, y + w->h, x + w->w, y + w->h) < 0) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
"Couldn't render widget: %s",
@@ -148,6 +146,14 @@ _mftk_text_render(struct mftk_widget *w, SDL_Renderer *renderer, int x, int y)
free(val);
return -1;
}
+ if (w->focused == SDL_TRUE && SDL_RenderDrawLine(renderer,
+ x + cur_x, y + t->y, x + cur_x, y + t->h) < 0) {
+ SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
+ "Couldn't render widget: %s",
+ SDL_GetError());
+ free(val);
+ return -1;
+ }
free(val);
return 0;