]> Dogcows Code - chaz/openbox/commitdiff
do horz grads without any multipliaction
authorDana Jansens <danakj@orodu.net>
Tue, 24 Jun 2003 18:56:47 +0000 (18:56 +0000)
committerDana Jansens <danakj@orodu.net>
Tue, 24 Jun 2003 18:56:47 +0000 (18:56 +0000)
render/gradient.c

index 6f976e0b0e6843fc3b7c9b3034e377d32ee620b5..a819a4bee9e988b859155ad73f94951b94a06422 100644 (file)
@@ -334,7 +334,7 @@ static void gradient_solid(RrAppearance *l, int w, int h)
 static void gradient_horizontal(RrSurface *sf, int w, int h)
 {
     int x, y;
-    RrPixel32 *data = sf->RrPixel_data;
+    RrPixel32 *data = sf->RrPixel_data, *datav;
     RrPixel32 current;
 
     VARS(x);
@@ -342,8 +342,11 @@ static void gradient_horizontal(RrSurface *sf, int w, int h)
 
     for (x = w - 1; x > 0; --x) {  /* 0 -> w-1 */
         current = COLOR(x);
-        for (y = h - 1; y >= 0; --y)  /* 0 -> h */
-            *(data + y * w) = current;
+        datav = data;
+        for (y = h - 1; y >= 0; --y) {  /* 0 -> h */
+            *datav = current;
+            datav += w;
+        }
         ++data;
 
         NEXT(x);
This page took 0.024587 seconds and 4 git commands to generate.