diff --git a/ChangeLog b/ChangeLog index c59c2968f..10d3c7475 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2013-07-25 Vladimir Testov + + * grub-core/gfxmenu/widget-box.c: Fixed draw function. Now it takes + maximum of NW, N, NE heights instead of N's height and maximum of + NW, W, SW widths instead of W's width. (So the box will be always + correctly drawn) + 2013-07-20 Grégoire Sutre * grub-core/partmap/bsdlabel.c (netopenbsdlabel_partition_map_iterate): diff --git a/grub-core/gfxmenu/widget-box.c b/grub-core/gfxmenu/widget-box.c index 18e2ef469..b60602889 100644 --- a/grub-core/gfxmenu/widget-box.c +++ b/grub-core/gfxmenu/widget-box.c @@ -80,9 +80,25 @@ draw (grub_gfxmenu_box_t self, int x, int y) { int height_n; int width_w; + int tmp; - height_n = get_height (self->scaled_pixmaps[BOX_PIXMAP_N]); - width_w = get_width (self->scaled_pixmaps[BOX_PIXMAP_W]); + /* Count maximum height of NW, N, NE. */ + height_n = get_height (self->scaled_pixmaps[BOX_PIXMAP_NW]); + tmp = get_height (self->scaled_pixmaps[BOX_PIXMAP_N]); + if (tmp > height_n) + height_n = tmp; + tmp = get_height (self->scaled_pixmaps[BOX_PIXMAP_NE]); + if (tmp > height_n) + height_n = tmp; + + /* Count maximum width of NW, W, SW. */ + width_w = get_width (self->scaled_pixmaps[BOX_PIXMAP_NW]); + tmp = get_width (self->scaled_pixmaps[BOX_PIXMAP_W]); + if (tmp > width_w) + width_w = tmp; + tmp = get_width (self->scaled_pixmaps[BOX_PIXMAP_SW]); + if (tmp > width_w) + width_w = tmp; /* Draw sides. */ blit (self, BOX_PIXMAP_N, x + width_w, y);