]> Dogcows Code - chaz/openbox/commitdiff
fix window icon rendering, was using incorrect size.
authorDana Jansens <danakj@orodu.net>
Sun, 27 Apr 2003 17:08:40 +0000 (17:08 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 27 Apr 2003 17:08:40 +0000 (17:08 +0000)
render/image.c
render/image.h
render/render.c

index 5bd3285b19b8cc67cf1a05771911f84b77d40127..bdc51eeda04562f0856c58723255dea9902566a6 100644 (file)
@@ -2,14 +2,20 @@
 #include "../kernel/geom.h"
 #include "image.h"
 
-void image_draw(pixel32 *target, TextureRGBA *rgba, Rect *position)
+void image_draw(pixel32 *target, TextureRGBA *rgba, Rect *position,
+                Rect *surarea)
 {
   unsigned long *draw = rgba->data;
   int c, sfw, sfh;
-  unsigned int i, e, bgi;
+  unsigned int i, e;
   sfw = position->width;
   sfh = position->height;
 
+  /* it would be nice if this worked, but this function is well broken in these
+     cercumstances. */
+  g_assert(position->width == surarea->width &&
+           position->height == surarea->height);
+
   g_assert(rgba->data != NULL);
 
   if ((rgba->width != sfw || rgba->height != sfh) &&
@@ -42,7 +48,7 @@ void image_draw(pixel32 *target, TextureRGBA *rgba, Rect *position)
         draw = rgba->cache;
 
     /* apply the alpha channel */
-    for (i = 0, c = 0, e = sfw*sfh; i < e; ++i, ++bgi) {
+    for (i = 0, c = 0, e = sfw*sfh; i < e; ++i) {
       unsigned char alpha = draw[i] >> 24;
       unsigned char r = draw[i] >> 16;
       unsigned char g = draw[i] >> 8;
index b29a73042b7bbe76e03b8d0f7df9c3808290215a..84f61d770374066a2df6925cb931938a25daf180 100644 (file)
@@ -4,6 +4,7 @@
 #include "render.h"
 #include "../kernel/geom.h"
 
-void image_draw(pixel32 *target, TextureRGBA *rgba, Rect *position);
+void image_draw(pixel32 *target, TextureRGBA *rgba, Rect *position,
+                Rect *surarea);
 
 #endif
index cd4607bbd465d696d1d897aadfff8e229be54033..a1412741bbc6aa44a3dffbbc94f834321e4aa03d 100644 (file)
@@ -233,20 +233,22 @@ void x_paint(Window win, Appearance *l)
 
     for (i = 0; i < l->textures; i++) {
         tarea = l->texture[i].position;
-        if (l->surface.data.planar.relief != Flat) {
-            switch (l->surface.data.planar.bevel) {
-            case Bevel1:
+        if (l->surface.data.planar.grad != Background_ParentRelative) {
+            if (l->surface.data.planar.relief != Flat) {
+                switch (l->surface.data.planar.bevel) {
+                case Bevel1:
+                    tarea.x += 1; tarea.y += 1;
+                    tarea.width -= 2; tarea.height -= 2;
+                    break;
+                case Bevel2:
+                    tarea.x += 2; tarea.y += 2;
+                    tarea.width -= 4; tarea.height -= 4;
+                    break;
+                }
+            } else if (l->surface.data.planar.border) {
                 tarea.x += 1; tarea.y += 1;
                 tarea.width -= 2; tarea.height -= 2;
-                break;
-            case Bevel2:
-                tarea.x += 2; tarea.y += 2;
-                tarea.width -= 4; tarea.height -= 4;
-                break;
             }
-        } else if (l->surface.data.planar.border) {
-            tarea.x += 1; tarea.y += 1;
-            tarea.width -= 2; tarea.height -= 2;
         }
 
         switch (l->texture[i].type) {
@@ -279,7 +281,7 @@ void x_paint(Window win, Appearance *l)
         case RGBA:
             image_draw(l->surface.data.planar.pixel_data, 
                        &l->texture[i].data.rgba,
-                       &tarea);
+                       &tarea, &l->area);
         break;
         }
     }
This page took 0.030607 seconds and 4 git commands to generate.