1
0
Fork 0
mirror of https://github.com/Cloudef/bemenu synced 2024-06-04 22:06:26 +02:00

fixed minor issues

This commit is contained in:
Lucas Merritt 2022-12-20 07:47:54 -07:00 committed by Jari Vetoniemi
parent 30379a88bf
commit a1374d487e

View File

@ -261,12 +261,12 @@ static inline void
bm_cairo_draw_rounded_path(cairo_t *cr, double x, double y, double width, double height, double radius)
{
double degrees = M_PI / 180;
cairo_new_sub_path (cr);
cairo_arc (cr, x + width - radius, y + radius, radius, -90 * degrees, 0 * degrees);
cairo_arc (cr, x + width - radius, y + height - radius, radius, 0 * degrees, 90 * degrees);
cairo_arc (cr, x + radius, y + height - radius, radius, 90 * degrees, 180 * degrees);
cairo_arc (cr, x + radius, y + radius, radius, 180 * degrees, 270 * degrees);
cairo_close_path (cr);
cairo_new_sub_path(cr);
cairo_arc(cr, x + width - radius, y + radius, radius, -90 * degrees, 0 * degrees);
cairo_arc(cr, x + width - radius, y + height - radius, radius, 0 * degrees, 90 * degrees);
cairo_arc(cr, x + radius, y + height - radius, radius, 90 * degrees, 180 * degrees);
cairo_arc(cr, x + radius, y + radius, radius, 180 * degrees, 270 * degrees);
cairo_close_path(cr);
}
static inline void
@ -483,7 +483,11 @@ bm_cairo_paint(struct cairo *cairo, uint32_t width, uint32_t max_height, const s
// Draw borders
bm_cairo_color_from_menu_color(menu, BM_COLOR_BORDER, &paint.fg);
cairo_set_source_rgba(cairo->cr, paint.fg.r, paint.fg.b, paint.fg.g, paint.fg.a);
bm_cairo_draw_rounded_path(cairo->cr, 0, 0, width + border_size, (height * (page_length + 1)) + (2 * border_size), border_radius);
if (!border_radius) {
cairo_rectangle(cairo->cr, 0, 0, width + border_size, (height * (page_length + 1)) + (2 * border_size));
} else {
bm_cairo_draw_rounded_path(cairo->cr, 0, 0, width + border_size, (height * (page_length + 1)) + (2 * border_size), border_radius);
}
cairo_set_line_width(cairo->cr, 2 * menu->border_size);
cairo_stroke(cairo->cr);