mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-02-03 18:07:53 +01:00
Part of #11562: gfx_draw_string_left_wrapped() overload
* gfx_draw_string_left_wrapped overload added Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
This commit is contained in:
@@ -212,6 +212,12 @@ void gfx_draw_string_right_clipped(
|
||||
// Wrapping
|
||||
int32_t gfx_draw_string_left_wrapped(
|
||||
rct_drawpixelinfo* dpi, void* args, int32_t x, int32_t y, int32_t width, rct_string_id format, uint8_t colour)
|
||||
{
|
||||
return gfx_draw_string_left_wrapped(dpi, args, { x, y }, width, format, colour);
|
||||
}
|
||||
|
||||
int32_t gfx_draw_string_left_wrapped(
|
||||
rct_drawpixelinfo* dpi, void* args, const ScreenCoordsXY& coords, int32_t width, rct_string_id format, uint8_t colour)
|
||||
{
|
||||
utf8 buffer[512];
|
||||
format_string(buffer, sizeof(buffer), format, args);
|
||||
@@ -224,7 +230,7 @@ int32_t gfx_draw_string_left_wrapped(
|
||||
_legacyPaint.SpriteBase = gCurrentFontSpriteBase;
|
||||
|
||||
StaticLayout layout(buffer, _legacyPaint, width);
|
||||
layout.Draw(dpi, x, y);
|
||||
layout.Draw(dpi, coords.x, coords.y);
|
||||
|
||||
return layout.GetHeight();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user