Skip to content

Commit 3d94bf4

Browse files
committed
Fix indicator diameter calculation
1 parent baa1ae9 commit 3d94bf4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

render.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,11 @@ void render_frame_background(struct swaylock_surface *surface) {
7171
void render_frame(struct swaylock_surface *surface) {
7272
struct swaylock_state *state = surface->state;
7373

74+
double border_width = 2.0 * surface->scale;
75+
7476
int arc_radius = state->args.radius * surface->scale;
7577
int arc_thickness = state->args.thickness * surface->scale;
76-
int buffer_diameter = (arc_radius + arc_thickness) * 2;
78+
int buffer_diameter = (arc_radius + border_width) * 2 + arc_thickness;
7779

7880
int buffer_width = surface->indicator_width;
7981
int buffer_height = surface->indicator_height;
@@ -261,7 +263,7 @@ void render_frame(struct swaylock_surface *surface) {
261263

262264
// Draw inner + outer border of the circle
263265
set_color_for_state(cairo, state, &state->args.colors.line);
264-
cairo_set_line_width(cairo, 2.0 * surface->scale);
266+
cairo_set_line_width(cairo, border_width);
265267
cairo_arc(cairo, buffer_width / 2, buffer_diameter / 2,
266268
arc_radius - arc_thickness / 2, 0, 2 * M_PI);
267269
cairo_stroke(cairo);

0 commit comments

Comments
 (0)