mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-09-22 23:18:01 +03:00
parts: use ceilf(ch->advance) for text layout
Fixes an issue in English version of Rance 9 where item description text was overly compressed. Now ChipmunkSpriteEngine.SP_GetFontWidth returns the same values as the official engine. There are still text layout bugs with item descriptions in Rance 9 (affecting both JP and EN versions), but this at least makes the text readable.
This commit is contained in:
@@ -250,7 +250,7 @@ static bool ChipmunkSpriteEngine_SP_GetFontWidth(struct string *text, int *width
|
||||
return true;
|
||||
}
|
||||
|
||||
*width = gfx_size_text(&text_sprite_ts, text->text);
|
||||
*width = ceilf(gfx_size_text(&text_sprite_ts, text->text));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -133,8 +133,9 @@ static void parts_render_text(struct parts *parts, struct parts_text *t)
|
||||
struct parts_text_char *ch = &line->chars[j];
|
||||
mat4 mw_transform = WORLD_TRANSFORM(ch->t.w, ch->t.h, x, y);
|
||||
Rectangle r = { 0, 0, ch->t.w, ch->t.h };
|
||||
parts_render_texture(&ch->t, mw_transform, &r, blend_rate, add_color, multiply_color, 0, parts->alpha_clipper_parts_no);
|
||||
x += ch->advance;
|
||||
parts_render_texture(&ch->t, mw_transform, &r, blend_rate, add_color,
|
||||
multiply_color, 0, parts->alpha_clipper_parts_no);
|
||||
x += ceilf(ch->advance);
|
||||
}
|
||||
x = parts->global.pos.x + t->common.origin_offset.x;
|
||||
y += line->height + t->line_space;
|
||||
|
||||
Reference in New Issue
Block a user