X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=render%2Fgradient.c;h=ad9154a681e5a433cfc36e7e0f360d71c6472e42;hb=00042637e8b8bef92456d96547230ec710cf6a7b;hp=f8a8cb14ce6b1778ab2a32da154c7491e2e0e218;hpb=0f25fd6ff02c65c5584ab1ec827ba60a32af8dc2;p=chaz%2Fopenbox diff --git a/render/gradient.c b/render/gradient.c index f8a8cb14..ad9154a6 100644 --- a/render/gradient.c +++ b/render/gradient.c @@ -28,6 +28,7 @@ void gradient_render(Surface *sf, int w, int h) break; default: g_message("unhandled gradient"); + return; } if (sf->data.planar.relief == Flat && sf->data.planar.border) { @@ -232,12 +233,21 @@ void highlight(pixel32 *x, pixel32 *y, gboolean raised) void gradient_solid(Appearance *l, int x, int y, int w, int h) { - int i; + pixel32 pix; + int i, a, b; PlanarSurface *sp = &l->surface.data.planar; int left = x, top = y, right = w - 1, bottom = h - 1; if (sp->primary->gc == None) color_allocate_gc(sp->primary); + pix = (sp->primary->r << default_red_shift) + + (sp->primary->g << default_green_shift) + + (sp->primary->b << default_blue_shift); + + for (a = 0; a < l->area.width; a++) + for (b = 0; b < l->area.height; b++) + sp->pixel_data[a + b*l->area.width] = pix; + XFillRectangle(ob_display, l->pixmap, sp->primary->gc , x, y, w, h);