changeset 32969:ad1a232df994

Make slabel work. It is amazing that so far no skin is using a slabel (static label), but the reason is quite simple. Former versions of the GUI crashed when rendering a slabel. The current GUI recognizes the malloc error but can't render the slabel due to (probable) lack of memory. An item that shall be fnt-rendered must have a valid item width. Additionally, a break was missing which caused a slabel that would have been already handled to erroneously run through the dlabel handling as well.
author ib
date Tue, 08 Mar 2011 15:29:19 +0000
parents 1fa7a299b1b4
children 3673c28ce811
files gui/mplayer/gui_common.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gui/mplayer/gui_common.c	Tue Mar 08 13:15:34 2011 +0000
+++ b/gui/mplayer/gui_common.c	Tue Mar 08 15:29:19 2011 +0000
@@ -431,9 +431,12 @@
             break;
 
         case itSLabel:
+            if (item->width == -1)
+                item->width = fntTextWidth(item->fontid, item->label);
             image = fntRender(item, 0, item->label);
             if (image)
                 PutImage(image, item->x, item->y, 1, 0);
+            break;
 
         case itDLabel:
         {