+2011-12-15 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * grub-core/gfxmenu/gui_label.c (label_paint): Handle the case
+ text_width > available width a bit more gracefully.
+
2011-12-15 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/loader/i386/bsdXX.c (grub_freebsd_load_elfmodule): Fix
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,