mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-29 07:23:01 +00:00
Adjust text in inputboxes
This commit is contained in:
parent
072c36c558
commit
8f2f46fbdc
2 changed files with 6 additions and 2 deletions
|
@ -19,7 +19,7 @@ static void djui_font_normal_render_char(char* c) {
|
|||
}
|
||||
|
||||
static f32 djui_font_normal_char_width(char* c) {
|
||||
if (*c == ' ') { return 0.30f; }
|
||||
if (*c == ' ') { return 0.20f; }
|
||||
extern const f32 font_normal_widths[];
|
||||
return djui_unicode_get_sprite_width(c, font_normal_widths);
|
||||
}
|
||||
|
|
|
@ -476,6 +476,10 @@ static bool djui_inputbox_render(struct DjuiBase* base) {
|
|||
const struct DjuiFont* font = gDjuiFonts[0];
|
||||
djui_rect_render(base);
|
||||
|
||||
// Shift the text away from the left side a tad
|
||||
comp->x += 2;
|
||||
comp->width -= 2;
|
||||
|
||||
// shift the viewing window to keep the selection in view
|
||||
djui_inputbox_keep_selection_in_view(inputbox);
|
||||
|
||||
|
@ -483,7 +487,7 @@ static bool djui_inputbox_render(struct DjuiBase* base) {
|
|||
f32 translatedX = comp->x + inputbox->viewX;
|
||||
f32 translatedY = comp->y + DJUI_INPUTBOX_YOFF;
|
||||
djui_gfx_position_translate(&translatedX, &translatedY);
|
||||
create_dl_translation_matrix(DJUI_MTX_PUSH, (int)translatedX, (int)translatedY, 0);
|
||||
create_dl_translation_matrix(DJUI_MTX_PUSH, translatedX, translatedY, 0);
|
||||
|
||||
// compute font size
|
||||
f32 translatedFontSize = font->defaultFontScale;
|
||||
|
|
Loading…
Reference in a new issue