[MPlayer-cvslog] r33056 - trunk/gui/mplayer/gui_common.c

ib subversion at mplayerhq.hu
Tue Mar 8 16:29:20 CET 2011


Author: ib
Date: Tue Mar  8 16:29:19 2011
New Revision: 33056

Log:
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.

Modified:
   trunk/gui/mplayer/gui_common.c

Modified: trunk/gui/mplayer/gui_common.c
==============================================================================
--- trunk/gui/mplayer/gui_common.c	Tue Mar  8 14:15:34 2011	(r33055)
+++ trunk/gui/mplayer/gui_common.c	Tue Mar  8 16:29:19 2011	(r33056)
@@ -431,9 +431,12 @@ void Render(wsTWindow *window, wItem *It
             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:
         {


More information about the MPlayer-cvslog mailing list