Oh. One more white-space removed. That's better.
-- 
With best regards,
_______________________________
Vladimir Testov, ROSA Laboratory.
www.rosalab.ru
diff -Naur grub-2.00/grub-core/gfxmenu/gui_list.c grub-new/grub-core/gfxmenu/gui_list.c
--- grub-2.00/grub-core/gfxmenu/gui_list.c	2011-12-14 14:36:07.000000000 +0400
+++ grub-new/grub-core/gfxmenu/gui_list.c	2013-02-06 15:06:36.620696079 +0400
@@ -228,7 +228,9 @@
   grub_gfxmenu_box_t selbox = self->selected_item_box;
   int sel_leftpad = selbox->get_left_pad (selbox);
   int sel_toppad = selbox->get_top_pad (selbox);
-  int item_top = sel_toppad;
+  int sel_vertical_pad = sel_toppad
+                        + selbox->get_bottom_pad (selbox);
+  int item_top = 0;
   int menu_index;
   int visible_index;
   struct grub_video_rect oviewport;
@@ -252,9 +254,13 @@
 	  int cwidth = oviewport.width - 2 * boxpad - 2;
 	  if (selbox->get_border_width)
 	    cwidth -= selbox->get_border_width (selbox);
-	  selbox->set_content_size (selbox, cwidth, item_height - 1);
-          selbox->draw (selbox, 0,
-                        item_top - sel_toppad);
+          int cheight = item_height - sel_vertical_pad;
+          if (cwidth < 1)
+            cwidth = 1;
+          if (cheight < 1)
+            cheight = 1;
+          selbox->set_content_size (selbox, cwidth, cheight);
+          selbox->draw (selbox, 0, item_top);
         }
 
       icon = get_item_icon (self, menu_index);
@@ -391,9 +397,6 @@
       int box_bottom_pad = box->get_bottom_pad (box);
       unsigned width_s;
 
-      grub_gfxmenu_box_t selbox = self->selected_item_box;
-      int sel_toppad = selbox->get_top_pad (selbox);
-      
       *width = grub_font_get_string_width (self->item_font, "Typical OS");
       width_s = grub_font_get_string_width (self->selected_item_font,
 					    "Typical OS");
@@ -406,7 +409,7 @@
       *height = (item_height * num_items
                  + item_vspace * (num_items - 1)
                  + 2 * boxpad
-                 + box_top_pad + box_bottom_pad + sel_toppad);
+                 + box_top_pad + box_bottom_pad);
     }
   else
     {
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to