From: Vladimir Testov Date: Thu, 25 Jul 2013 14:15:15 +0000 (+0400) Subject: * grub-core/gfxmenu/widget-box.c: Fixed draw function. Now it takes X-Git-Tag: grub-2.02-beta1~928 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba8bc620d1907e3fd4b57bbc06fe626dfc598394;p=thirdparty%2Fgrub.git * 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) --- 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; - - height_n = get_height (self->scaled_pixmaps[BOX_PIXMAP_N]); - width_w = get_width (self->scaled_pixmaps[BOX_PIXMAP_W]); + int tmp; + + /* 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);