@@ -36,26 +36,26 @@ static void move_to(cairo_t *cairo, double x, double y, int scale) {
36
36
}
37
37
38
38
static void set_rounded_rectangle (cairo_t * cairo , double x , double y , double width , double height ,
39
- int scale , int radius_top , int radius_right , int radius_bottom , int radius_left ) {
39
+ int scale , int radius_top_left , int radius_top_right , int radius_bottom_right , int radius_bottom_left ) {
40
40
if (width == 0 || height == 0 ) {
41
41
return ;
42
42
}
43
43
x *= scale ;
44
44
y *= scale ;
45
45
width *= scale ;
46
46
height *= scale ;
47
- radius_top *= scale ;
48
- radius_right *= scale ;
49
- radius_bottom *= scale ;
50
- radius_left *= scale ;
47
+ radius_top_left *= scale ;
48
+ radius_top_right *= scale ;
49
+ radius_bottom_right *= scale ;
50
+ radius_bottom_left *= scale ;
51
51
double degrees = M_PI / 180.0 ;
52
52
53
53
cairo_new_sub_path (cairo );
54
54
55
- cairo_arc (cairo , x + width - radius_right , y + radius_right , radius_right , -90 * degrees , 0 * degrees );
56
- cairo_arc (cairo , x + width - radius_left , y + height - radius_left , radius_left , 0 * degrees , 90 * degrees );
57
- cairo_arc (cairo , x + radius_bottom , y + height - radius_bottom , radius_bottom , 90 * degrees , 180 * degrees );
58
- cairo_arc (cairo , x + radius_top , y + radius_top , radius_top , 180 * degrees , 270 * degrees );
55
+ cairo_arc (cairo , x + radius_top_left , y + radius_top_left , radius_top_left , 180 * degrees , 270 * degrees );
56
+ cairo_arc (cairo , x + width - radius_top_right , y + radius_top_right , radius_top_right , -90 * degrees , 0 * degrees );
57
+ cairo_arc (cairo , x + width - radius_bottom_right , y + height - radius_bottom_right , radius_bottom_right , 0 * degrees , 90 * degrees );
58
+ cairo_arc (cairo , x + radius_bottom_left , y + height - radius_bottom_left , radius_bottom_left , 90 * degrees , 180 * degrees );
59
59
60
60
cairo_close_path (cairo );
61
61
}
@@ -101,10 +101,10 @@ static int render_notification(cairo_t *cairo, struct mako_state *state, struct
101
101
int border_size = 2 * style -> border_size ;
102
102
int padding_height = style -> padding .top + style -> padding .bottom ;
103
103
int padding_width = style -> padding .left + style -> padding .right ;
104
- int radius_top = style -> border_radius .top ;
105
- int radius_right = style -> border_radius .right ;
106
- int radius_bottom = style -> border_radius .bottom ;
107
- int radius_left = style -> border_radius .left ;
104
+ int radius_top_left = style -> border_radius .top ;
105
+ int radius_top_right = style -> border_radius .right ;
106
+ int radius_bottom_right = style -> border_radius .bottom ;
107
+ int radius_bottom_left = style -> border_radius .left ;
108
108
int icon_radius = style -> icon_border_radius ;
109
109
bool icon_vertical = style -> icon_location == MAKO_ICON_LOCATION_TOP ||
110
110
style -> icon_location == MAKO_ICON_LOCATION_BOTTOM ;
@@ -204,11 +204,11 @@ static int render_notification(cairo_t *cairo, struct mako_state *state, struct
204
204
if (icon != NULL && ! icon_vertical && icon -> height > text_height ) {
205
205
notif_height = icon -> height + border_size + padding_height ;
206
206
}
207
- if (notif_height < radius_top + radius_bottom ) {
208
- notif_height = radius_top + radius_bottom + border_size ;
207
+ if (notif_height < radius_top_left + radius_bottom_left ) {
208
+ notif_height = radius_top_left + radius_bottom_left + border_size ;
209
209
}
210
- if (notif_height < radius_right + radius_left ) {
211
- notif_height = radius_right + radius_left + border_size ;
210
+ if (notif_height < radius_top_right + radius_bottom_right ) {
211
+ notif_height = radius_top_right + radius_bottom_right + border_size ;
212
212
}
213
213
214
214
int notif_background_width = notif_width - style -> border_size ;
@@ -221,7 +221,7 @@ static int render_notification(cairo_t *cairo, struct mako_state *state, struct
221
221
offset_y + style -> border_size / 2.0 ,
222
222
notif_background_width ,
223
223
notif_height - style -> border_size ,
224
- scale , radius_top , radius_right , radius_bottom , radius_left );
224
+ scale , radius_top_left , radius_top_right , radius_bottom_right , radius_bottom_left );
225
225
226
226
// Render background, keeping the path.
227
227
set_source_u32 (cairo , style -> colors .background );
0 commit comments