mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-27 01:29:27 +00:00
* grub-core/gfxmenu/gui_label.c (label_paint): Handle the case
text_width > available width a bit more gracefully.
This commit is contained in:
1 parent
384ad7cc1b
commit
c476e6df16
2 files changed
+10
-3
No files matched your search
@@ -94,15 +94,17 @@ label_paint (void *vself, const grub_video_rect_t *region)
|
||||
if (self->align == align_left)
|
||||
left_x = 0;
|
||||
else if (self->align == align_center)
|
||||
left_x = ((self->bounds.width
|
||||
- grub_font_get_string_width (self->font, self->text))
|
||||
) / 2;
|
||||
left_x = (self->bounds.width
|
||||
- grub_font_get_string_width (self->font, self->text)) / 2;
|
||||
else if (self->align == align_right)
|
||||
left_x = (self->bounds.width
|
||||
- grub_font_get_string_width (self->font, self->text));
|
||||
else
|
||||
return; /* Invalid alignment. */
|
||||
|
||||
if (left_x < 0 || left_x > (int) self->bounds.width)
|
||||
left_x = 0;
|
||||
|
||||
grub_video_rect_t vpsave;
|
||||
grub_gui_set_viewport (&self->bounds, &vpsave);
|
||||
grub_font_draw_string (self->text,
|
||||
|
||||
Reference in new issue
Block a user