]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/gfxmenu/gui_progress_bar.c (draw_pixmap_bar): Fixed bug.
authorVladimir Testov <vladimir.testov@rosalab.ru>
Thu, 17 Oct 2013 11:34:04 +0000 (15:34 +0400)
committerVladimir Testov <vladimir.testov@rosalab.ru>
Thu, 17 Oct 2013 11:34:04 +0000 (15:34 +0400)
        Pixmap highlighted section with east and west slices was displayed
        incorrectly due to negative width of the central slice.

ChangeLog
grub-core/gfxmenu/gui_progress_bar.c

index 95203326b48b888700466de2f13013fd324b5ea5..52d856671d58d032574620af1194702db851a728 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-10-17  Vladimir Testov  <vladimir.testov@rosalab.ru>
+
+       * grub-core/gfxmenu/gui_progress_bar.c (draw_pixmap_bar): Fixed bug.
+       Pixmap highlighted section with east and west slices was displayed
+       incorrectly due to negative width of the central slice.
+
 2013-10-17  Vladimir Testov  <vladimir.testov@rosalab.ru>
 
        * docs/grub.texi: Graphical options information update.
index 4294b7beb493019a7d258f094bdf99fd7d694515..946ec3683e8d742ec7e5e62a6ee4720375d25f98 100644 (file)
@@ -154,14 +154,16 @@ draw_pixmap_bar (grub_gui_progress_bar_t self)
   int barwidth;
 
   bar->set_content_size (bar, tracklen, trackheight);
+  bar->draw (bar, 0, 0);
 
   barwidth = (tracklen * (self->value - self->start) 
              / (self->end - self->start));
 
-  hl->set_content_size (hl, barwidth - hl_h_pad, h - bar_v_pad - hl_v_pad);
-
-  bar->draw (bar, 0, 0);
-  hl->draw (hl, bar_l_pad, bar_t_pad);
+  if (barwidth >= hl_h_pad)
+    {
+      hl->set_content_size (hl, barwidth - hl_h_pad, h - bar_v_pad - hl_v_pad);
+      hl->draw (hl, bar_l_pad, bar_t_pad);
+    }
 }
 
 static void