patch from thorsten vollmer to fix bug #2506, interlaces and bevels not drawing correctly
This commit is contained in:
parent
d77c8f62f2
commit
e8c19d0c99
2 changed files with 21 additions and 26 deletions
|
@ -191,8 +191,9 @@ static void create_bevel_colors(RrAppearance *l)
|
|||
|
||||
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,20 +201,15 @@ static void gradient_solid(RrAppearance *l, gint w, gint h)
|
|||
+ (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:
|
||||
if (!sp->bevel_dark)
|
||||
|
@ -233,14 +229,14 @@ static void gradient_solid(RrAppearance *l, gint w, gint h)
|
|||
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 @@ static void gradient_solid(RrAppearance *l, gint w, gint h)
|
|||
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 */
|
||||
|
|
|
@ -113,7 +113,7 @@ void RrPaint(RrAppearance *a, Window win, gint w, gint h)
|
|||
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 @@ void RrPaint(RrAppearance *a, Window win, gint w, gint h)
|
|||
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 @@ void RrPaint(RrAppearance *a, Window win, gint w, gint h)
|
|||
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 @@ void RrPaint(RrAppearance *a, Window win, gint w, gint h)
|
|||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue