all repos — openbox @ e8c19d0c99930e9bc495c0bf0cbe5d94e6d8dd0f

openbox fork - make it a bit more like ryudo

patch from thorsten vollmer to fix bug #2506, interlaces and bevels not drawing correctly
Mikael Magnusson mikachu@comhem.se
commit

e8c19d0c99930e9bc495c0bf0cbe5d94e6d8dd0f

parent

d77c8f62f2f908cfe1d09686a35dce1ccaf65aec

2 files changed, 20 insertions(+), 25 deletions(-)

jump to
M render/gradient.crender/gradient.c

@@ -191,8 +191,9 @@ }

static void gradient_solid(RrAppearance *l, gint w, gint h) { + gint i; RrPixel32 pix; - gint i, a, b; + RrPixel32 *data = l->surface.pixel_data; RrSurface *sp = &l->surface; gint left = 0, top = 0, right = w - 1, bottom = h - 1;

@@ -200,19 +201,14 @@ pix = (sp->primary->r << RrDefaultRedOffset)

+ (sp->primary->g << RrDefaultGreenOffset) + (sp->primary->b << RrDefaultBlueOffset); - for (a = 0; a < w; a++) - for (b = 0; b < h; b++) - sp->pixel_data[a + b * w] = pix; + for (i = 0; i < w * h; i++) + *data++ = pix; + + if (sp->interlaced) + return; XFillRectangle(RrDisplay(l->inst), l->pixmap, RrColorGC(sp->primary), 0, 0, w, h); - - if (sp->interlaced) { - for (i = 0; i < h; i += 2) - XDrawLine(RrDisplay(l->inst), l->pixmap, - RrColorGC(sp->interlace_color), - 0, i, w, i); - } switch (sp->relief) { case RR_RELIEF_RAISED:

@@ -233,14 +229,14 @@ left, bottom, left, top);

break; case RR_BEVEL_2: XDrawLine(RrDisplay(l->inst), l->pixmap, RrColorGC(sp->bevel_dark), - left + 1, bottom - 2, right - 2, bottom - 2); + left + 2, bottom - 1, right - 2, bottom - 1); XDrawLine(RrDisplay(l->inst), l->pixmap, RrColorGC(sp->bevel_dark), - right - 2, bottom - 2, right - 2, top + 1); + right - 1, bottom - 1, right - 1, top + 1); XDrawLine(RrDisplay(l->inst), l->pixmap,RrColorGC(sp->bevel_light), - left + 1, top + 1, right - 2, top + 1); + left + 2, top + 1, right - 2, top + 1); XDrawLine(RrDisplay(l->inst), l->pixmap,RrColorGC(sp->bevel_light), - left + 1, bottom - 2, left + 1, top + 1); + left + 1, bottom - 1, left + 1, top + 1); break; default: g_assert_not_reached(); /* unhandled BevelType */

@@ -264,15 +260,14 @@ left, bottom, left, top);

break; case RR_BEVEL_2: XDrawLine(RrDisplay(l->inst), l->pixmap,RrColorGC(sp->bevel_light), - left + 1, bottom - 2, right - 2, bottom - 2); + left + 2, bottom - 1, right - 2, bottom - 1); XDrawLine(RrDisplay(l->inst), l->pixmap,RrColorGC(sp->bevel_light), - right - 2, bottom - 2, right - 2, top + 1); - + right - 1, bottom - 1, right - 1, top + 1); + XDrawLine(RrDisplay(l->inst), l->pixmap, RrColorGC(sp->bevel_dark), - left + 1, top + 1, right - 2, top + 1); + left + 2, top + 1, right - 2, top + 1); XDrawLine(RrDisplay(l->inst), l->pixmap, RrColorGC(sp->bevel_dark), - left + 1, bottom - 2, left + 1, top + 1); - + left + 1, bottom - 1, left + 1, top + 1); break; default: g_assert_not_reached(); /* unhandled BevelType */
M render/render.crender/render.c

@@ -113,7 +113,7 @@ break;

case RR_TEXTURE_TEXT: if (!transferred) { transferred = 1; - if (a->surface.grad != RR_SURFACE_SOLID) + if ((a->surface.grad != RR_SURFACE_SOLID) || (a->surface.interlaced)) pixel_data_to_pixmap(a, 0, 0, w, h); } if (a->xftdraw == NULL) {

@@ -126,7 +126,7 @@ break;

case RR_TEXTURE_LINE_ART: if (!transferred) { transferred = 1; - if (a->surface.grad != RR_SURFACE_SOLID) + if ((a->surface.grad != RR_SURFACE_SOLID) || (a->surface.interlaced)) pixel_data_to_pixmap(a, 0, 0, w, h); } XDrawLine(RrDisplay(a->inst), a->pixmap,

@@ -139,7 +139,7 @@ break;

case RR_TEXTURE_MASK: if (!transferred) { transferred = 1; - if (a->surface.grad != RR_SURFACE_SOLID) + if ((a->surface.grad != RR_SURFACE_SOLID) || (a->surface.interlaced)) pixel_data_to_pixmap(a, 0, 0, w, h); } RrPixmapMaskDraw(a->pixmap, &a->texture[i].data.mask, &tarea);

@@ -156,7 +156,7 @@ }

if (!transferred) { transferred = 1; - if (a->surface.grad != RR_SURFACE_SOLID) + if ((a->surface.grad != RR_SURFACE_SOLID) || (a->surface.interlaced)) pixel_data_to_pixmap(a, 0, 0, w, h); }