]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/gfxmenu/widget-box.c: Fixed draw function. Now it takes
authorVladimir Testov <vladimir.testov@rosalab.ru>
Thu, 25 Jul 2013 14:15:15 +0000 (18:15 +0400)
committerVladimir Testov <vladimir.testov@rosalab.ru>
Thu, 25 Jul 2013 14:15:15 +0000 (18:15 +0400)
       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)

ChangeLog
grub-core/gfxmenu/widget-box.c

index c59c2968f19ec40a00bf3093dd41f5c01e51b02d..10d3c7475decf4fab7fb652277894d1c5978eb56 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-07-25  Vladimir Testov <vladimir.testov@rosalab.ru>
+
+       * 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  <gregoire.sutre@gmail.com>
 
        * grub-core/partmap/bsdlabel.c (netopenbsdlabel_partition_map_iterate):
index 18e2ef46963d549a42a827acc2d4b4328826d8af..b60602889143579094088a9fa001207f000d9b8c 100644 (file)
@@ -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);