Fix text positioning when clipped to a viewport.

Should fix the lua console, and the credits screen.
This commit is contained in:
Tommy 2022-06-11 15:37:03 +12:00
parent 0093d64296
commit 0d30c9d7c3

View File

@ -566,7 +566,9 @@ void text_shape::draw(
// TODO: highdpi - don't use preclipped texture, rather set clip area.
SDL_Rect text_draw_location = draw_location;
text_draw_location.x += rects.dst_in_viewport.x;
text_draw_location.x += rects.clip_in_shape.x;
text_draw_location.y += rects.dst_in_viewport.y;
text_draw_location.y += rects.clip_in_shape.y;
text_draw_location.w = rects.dst_in_viewport.w;
text_draw_location.h = rects.dst_in_viewport.h;
draw::blit(tex, text_draw_location);