Skip to content

Commit

Permalink
Merge pull request #6763 from mesilliac/scrolling_text_fix
Browse files Browse the repository at this point in the history
Fix text positioning when clipped to a viewport.
  • Loading branch information
CelticMinstrel committed Jun 11, 2022
2 parents 1769b6c + 0d30c9d commit e0504dc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/gui/core/canvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e0504dc

Please sign in to comment.