[common/draw] curious (cairo?) bug, sometimes draws the line 1 pixel to much on the right
happens only when creating a gradient, and not always, and adding + 1 (creating a slightly diagonal gradient), seems to help a little bit).
This commit is contained in:
parent
727a42eb41
commit
62ac090368
|
@ -307,10 +307,12 @@ draw_setup_cairo_color_source(DrawCtx *ctx, area_t rect,
|
||||||
cairo_set_source_rgb(ctx->cr, pcolor->red / 65535.0, pcolor->green / 65535.0, pcolor->blue / 65535.0);
|
cairo_set_source_rgb(ctx->cr, pcolor->red / 65535.0, pcolor->green / 65535.0, pcolor->blue / 65535.0);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pat = cairo_pattern_create_linear(rect.x, rect.y, rect.x + rect.width, rect.y + rect.height);
|
/* rext.x + 1 -> else will draw 1 pixel too much to the right or
|
||||||
|
* similar - cairo bug? */
|
||||||
|
pat = cairo_pattern_create_linear(rect.x - 1, rect.y, rect.x + 1 + rect.width, rect.y + rect.height);
|
||||||
|
|
||||||
/* pcolor is always set (so far in awesome) */
|
/* pcolor is always set (so far in awesome) */
|
||||||
cairo_pattern_add_color_stop_rgb(pat, 0, pcolor->red / 65535.0,
|
cairo_pattern_add_color_stop_rgb(pat, 0.0, pcolor->red / 65535.0,
|
||||||
pcolor->green / 65535.0, pcolor->blue / 65535.0);
|
pcolor->green / 65535.0, pcolor->blue / 65535.0);
|
||||||
|
|
||||||
if(pcolor_center)
|
if(pcolor_center)
|
||||||
|
@ -318,10 +320,10 @@ draw_setup_cairo_color_source(DrawCtx *ctx, area_t rect,
|
||||||
pcolor_center->green / 65535.0, pcolor_center->blue / 65535.0);
|
pcolor_center->green / 65535.0, pcolor_center->blue / 65535.0);
|
||||||
|
|
||||||
if(pcolor_end)
|
if(pcolor_end)
|
||||||
cairo_pattern_add_color_stop_rgb(pat, 1, pcolor_end->red / 65535.0,
|
cairo_pattern_add_color_stop_rgb(pat, 1.0, pcolor_end->red / 65535.0,
|
||||||
pcolor_end->green / 65535.0, pcolor_end->blue / 65535.0);
|
pcolor_end->green / 65535.0, pcolor_end->blue / 65535.0);
|
||||||
else
|
else
|
||||||
cairo_pattern_add_color_stop_rgb(pat, 1, pcolor->red / 65535.0,
|
cairo_pattern_add_color_stop_rgb(pat, 1.0, pcolor->red / 65535.0,
|
||||||
pcolor->green / 65535.0, pcolor->blue / 65535.0);
|
pcolor->green / 65535.0, pcolor->blue / 65535.0);
|
||||||
cairo_set_source(ctx->cr, pat);
|
cairo_set_source(ctx->cr, pat);
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,11 +115,11 @@ graph_draw(Widget *widget, DrawCtx *ctx, int offset,
|
||||||
rectangle.x++;
|
rectangle.x++;
|
||||||
rectangle.y++;
|
rectangle.y++;
|
||||||
rectangle.width = d->size;
|
rectangle.width = d->size;
|
||||||
rectangle.height -= 2;
|
rectangle.height = d->box_height;
|
||||||
draw_rectangle(ctx, rectangle, 1.0, True, d->bg);
|
draw_rectangle(ctx, rectangle, 1.0, True, d->bg);
|
||||||
|
|
||||||
/* for graph drawing */
|
/* for graph drawing */
|
||||||
rectangle.x = widget->area.x + 2;
|
rectangle.x++; /* I won't know why */
|
||||||
rectangle.y = margin_top + d->box_height + 1; /* bottom left corner as starting point */
|
rectangle.y = margin_top + d->box_height + 1; /* bottom left corner as starting point */
|
||||||
rectangle.width = d->size; /* rectangle.height is not used */
|
rectangle.width = d->size; /* rectangle.height is not used */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue