test/testime.c
changeset 10100 a18ec339c8d3
parent 10097 06085b9c73ef
child 10111 c14536d0deff
     1.1 --- a/test/testime.c	Wed Mar 02 20:25:23 2016 +0100
     1.2 +++ b/test/testime.c	Thu Mar 03 20:11:43 2016 +0100
     1.3 @@ -29,8 +29,10 @@
     1.4  static SDLTest_CommonState *state;
     1.5  static SDL_Rect textRect, markedRect;
     1.6  static SDL_Color lineColor = {0,0,0,0};
     1.7 -static SDL_Color backColor = {255,255,255,0};
     1.8 +static SDL_Color backColor = {255,255,255,255};
     1.9 +#ifdef HAVE_SDL_TTF
    1.10  static SDL_Color textColor = {0,0,0,0};
    1.11 +#endif
    1.12  static char text[MAX_TEXT_LENGTH], markedText[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
    1.13  static int cursor = 0;
    1.14  #ifdef HAVE_SDL_TTF
    1.15 @@ -113,7 +115,7 @@
    1.16      int w = 0, h = textRect.h;
    1.17      SDL_Rect cursorRect, underlineRect;
    1.18  
    1.19 -    SDL_SetRenderDrawColor(renderer, 255,255,255,255);
    1.20 +    SDL_SetRenderDrawColor(renderer, backColor.r, backColor.g, backColor.b, backColor.a);
    1.21      SDL_RenderFillRect(renderer,&textRect);
    1.22  
    1.23  #ifdef HAVE_SDL_TTF
    1.24 @@ -148,7 +150,7 @@
    1.25      cursorRect.w = 2;
    1.26      cursorRect.h = h;
    1.27  
    1.28 -    SDL_SetRenderDrawColor(renderer, 255,255,255,255);
    1.29 +    SDL_SetRenderDrawColor(renderer, backColor.r, backColor.g, backColor.b, backColor.a);
    1.30      SDL_RenderFillRect(renderer,&markedRect);
    1.31  
    1.32      if (markedText[0])
    1.33 @@ -182,11 +184,11 @@
    1.34          underlineRect.h = 2;
    1.35          underlineRect.w = w;
    1.36  
    1.37 -        SDL_SetRenderDrawColor(renderer, 0,0,0,0);
    1.38 +        SDL_SetRenderDrawColor(renderer, lineColor.r, lineColor.g, lineColor.b, lineColor.a);
    1.39          SDL_RenderFillRect(renderer,&markedRect);
    1.40      }
    1.41  
    1.42 -    SDL_SetRenderDrawColor(renderer, 0,0,0,0);
    1.43 +    SDL_SetRenderDrawColor(renderer, lineColor.r, lineColor.g, lineColor.b, lineColor.a);
    1.44      SDL_RenderFillRect(renderer,&cursorRect);
    1.45  
    1.46      SDL_SetTextInputRect(&markedRect);