rg_gui: Fixed RG_TEXT_ALIGN_LEFT meant RG_TEXT_ALIGN_RIGHT
This commit is contained in:
parent
91044f8ea6
commit
53b9959dc7
@ -392,7 +392,7 @@ rg_rect_t rg_gui_draw_text(int x_pos, int y_pos, int width, const char *text, //
|
||||
{
|
||||
int x_offset = padding;
|
||||
|
||||
if (flags & (RG_TEXT_ALIGN_LEFT|RG_TEXT_ALIGN_CENTER))
|
||||
if (flags & (RG_TEXT_ALIGN_RIGHT|RG_TEXT_ALIGN_CENTER))
|
||||
{
|
||||
// Find the current line's text width
|
||||
const char *line = ptr;
|
||||
@ -406,7 +406,7 @@ rg_rect_t rg_gui_draw_text(int x_pos, int y_pos, int width, const char *text, //
|
||||
}
|
||||
if (flags & RG_TEXT_ALIGN_CENTER)
|
||||
x_offset = (draw_width - x_offset) / 2;
|
||||
else if (flags & RG_TEXT_ALIGN_LEFT)
|
||||
else if (flags & RG_TEXT_ALIGN_RIGHT)
|
||||
x_offset = draw_width - x_offset;
|
||||
}
|
||||
|
||||
|
||||
@ -490,8 +490,8 @@ void gui_draw_status(tab_t *tab)
|
||||
char *txt_left = tab->status[tab->status[1].left[0] ? 1 : 0].left;
|
||||
char *txt_right = tab->status[tab->status[1].right[0] ? 1 : 0].right;
|
||||
|
||||
rg_gui_draw_text(status_x, status_y, gui.width - status_x, txt_right, gui.theme->foreground, C_TRANSPARENT, RG_TEXT_ALIGN_LEFT);
|
||||
rg_gui_draw_text(status_x, status_y, 0, txt_left, gui.theme->foreground, C_TRANSPARENT, RG_TEXT_ALIGN_RIGHT);
|
||||
rg_gui_draw_text(status_x, status_y, gui.width - status_x, txt_right, gui.theme->foreground, C_TRANSPARENT, RG_TEXT_ALIGN_RIGHT);
|
||||
rg_gui_draw_text(status_x, status_y, 0, txt_left, gui.theme->foreground, C_TRANSPARENT, RG_TEXT_ALIGN_LEFT);
|
||||
rg_gui_draw_icons();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user