Draw background correctly (issue #580, thanks @stophe)
This commit is contained in:
parent
78bc8b5c74
commit
78bc215677
1 changed files with 24 additions and 16 deletions
|
@ -521,40 +521,48 @@ void draw_rect_on_sides(cairo_t *c, double x, double y, double w, double h, doub
|
||||||
else
|
else
|
||||||
cairo_rel_move_to(c, w - 2 * r, y);
|
cairo_rel_move_to(c, w - 2 * r, y);
|
||||||
// Top right corner
|
// Top right corner
|
||||||
if (r > 0 && (border_mask & BORDER_TOP) && (border_mask & BORDER_RIGHT))
|
if (r > 0) {
|
||||||
cairo_rel_curve_to(c, c1, 0.0, r, c1, r, r);
|
if ((border_mask & BORDER_TOP) && (border_mask & BORDER_RIGHT))
|
||||||
else
|
cairo_rel_curve_to(c, c1, 0.0, r, c1, r, r);
|
||||||
cairo_rel_move_to(c, r, r);
|
else
|
||||||
|
cairo_rel_move_to(c, r, r);
|
||||||
|
}
|
||||||
// Right line
|
// Right line
|
||||||
if (border_mask & BORDER_RIGHT)
|
if (border_mask & BORDER_RIGHT)
|
||||||
cairo_rel_line_to(c, 0, h - 2 * r);
|
cairo_rel_line_to(c, 0, h - 2 * r);
|
||||||
else
|
else
|
||||||
cairo_rel_move_to(c, 0, h - 2 * r);
|
cairo_rel_move_to(c, 0, h - 2 * r);
|
||||||
// Bottom right corner
|
// Bottom right corner
|
||||||
if (r > 0 && (border_mask & BORDER_RIGHT) && (border_mask & BORDER_BOTTOM))
|
if (r > 0) {
|
||||||
cairo_rel_curve_to(c, 0.0, c1, c1 - r, r, -r, r);
|
if ((border_mask & BORDER_RIGHT) && (border_mask & BORDER_BOTTOM))
|
||||||
else
|
cairo_rel_curve_to(c, 0.0, c1, c1 - r, r, -r, r);
|
||||||
cairo_rel_move_to(c, -r, r);
|
else
|
||||||
|
cairo_rel_move_to(c, -r, r);
|
||||||
|
}
|
||||||
// Bottom line
|
// Bottom line
|
||||||
if (border_mask & BORDER_BOTTOM)
|
if (border_mask & BORDER_BOTTOM)
|
||||||
cairo_rel_line_to(c, -w + 2 * r, 0);
|
cairo_rel_line_to(c, -w + 2 * r, 0);
|
||||||
else
|
else
|
||||||
cairo_rel_move_to(c, -w + 2 * r, 0);
|
cairo_rel_move_to(c, -w + 2 * r, 0);
|
||||||
// Bottom left corner
|
// Bottom left corner
|
||||||
if (r > 0 && (border_mask & BORDER_LEFT) && (border_mask & BORDER_BOTTOM))
|
if (r > 0) {
|
||||||
cairo_rel_curve_to(c, -c1, 0, -r, -c1, -r, -r);
|
if ((border_mask & BORDER_LEFT) && (border_mask & BORDER_BOTTOM))
|
||||||
else
|
cairo_rel_curve_to(c, -c1, 0, -r, -c1, -r, -r);
|
||||||
cairo_rel_move_to(c, -r, -r);
|
else
|
||||||
|
cairo_rel_move_to(c, -r, -r);
|
||||||
|
}
|
||||||
// Left line
|
// Left line
|
||||||
if (border_mask & BORDER_LEFT)
|
if (border_mask & BORDER_LEFT)
|
||||||
cairo_rel_line_to(c, 0, -h + 2 * r);
|
cairo_rel_line_to(c, 0, -h + 2 * r);
|
||||||
else
|
else
|
||||||
cairo_rel_move_to(c, 0, -h + 2 * r);
|
cairo_rel_move_to(c, 0, -h + 2 * r);
|
||||||
// Top left corner
|
// Top left corner
|
||||||
if (r > 0 && (border_mask & BORDER_LEFT) && (border_mask & BORDER_TOP))
|
if (r > 0) {
|
||||||
cairo_rel_curve_to(c, 0, -c1, r - c1, -r, r, -r);
|
if ((border_mask & BORDER_LEFT) && (border_mask & BORDER_TOP))
|
||||||
else
|
cairo_rel_curve_to(c, 0, -c1, r - c1, -r, r, -r);
|
||||||
cairo_rel_move_to(c, r, -r);
|
else
|
||||||
|
cairo_rel_move_to(c, r, -r);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear_pixmap(Pixmap p, int x, int y, int w, int h)
|
void clear_pixmap(Pixmap p, int x, int y, int w, int h)
|
||||||
|
|
Loading…
Reference in a new issue