fix newline
[enigma2.git] / lib / gdi / gpixmap.cpp
index dbf53838087fa3dc81b836dd6ceeecc33fb0c773..aaffbaa71c8743c16b18d9dcb2a5bbbe8650ea80 100644 (file)
@@ -182,6 +182,7 @@ void gPixmap::blit(const gPixmap &src, ePoint pos, const gRegion &clip, int flag
                eRect area=eRect(pos, src.size());
                area&=clip.rects[i];
                area&=eRect(ePoint(0, 0), size());
+
                if ((area.width()<0) || (area.height()<0))
                        continue;
 
@@ -309,7 +310,7 @@ void gPixmap::blit(const gPixmap &src, ePoint pos, const gRegion &clip, int flag
                                                // use duff's device here!
                                        while (width--)
                                        {
-                                               if (!*src)
+                                               if (*src==0x01)
                                                {
                                                        src++;
                                                        dst++;
@@ -469,6 +470,10 @@ fail:
 
 gColor gPalette::findColor(const gRGB &rgb) const
 {
+               /* grayscale? */
+       if (!data)
+               return (rgb.r + rgb.g + rgb.b) / 3;
+       
        int difference=1<<30, best_choice=0;
        for (int t=0; t<colors; t++)
        {