destRect.w = dstrect->w;
        destRect.h = 1;
        SDL_FillRect(dst, &destRect, color);
-       destRect.y += dstrect->h - 1;
+       destRect.x = dstrect->x;
+       destRect.y = dstrect->y + dstrect->h - 1;
+       destRect.w = dstrect->w;
+       destRect.h = 1;
        SDL_FillRect(dst, &destRect, color);
+       destRect.x = dstrect->x;
        destRect.y = dstrect->y;
        destRect.w = 1;
        destRect.h = dstrect->h;
        SDL_FillRect(dst, &destRect, color);
-       destRect.x += dstrect->w - 1;
+       destRect.x = dstrect->x + dstrect->w - 1;
+       destRect.y = dstrect->y;
+       destRect.w = 1;
+       destRect.h = dstrect->h;
        SDL_FillRect(dst, &destRect, color);
 }