Skip to content

Commit fdabe9d

Browse files
committed
Fix gradient size
1 parent 07528f4 commit fdabe9d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/draw.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,8 @@ static void render_content(cairo_t *c, struct colored_layout *cl, int width, int
870870
frame_y = h_without_progress_bar,
871871
progress_width_without_frame = progress_width - 2 * frame_width,
872872
progress_width_1 = progress_width_without_frame * progress / 100,
873-
progress_width_2 = progress_width_without_frame - 1;
873+
progress_width_2 = progress_width_without_frame - 1,
874+
progress_width_scaled = (progress_width + 1) * scale;
874875

875876
switch (cl->n->progress_bar_alignment) {
876877
case PANGO_ALIGN_LEFT:
@@ -902,7 +903,7 @@ static void render_content(cairo_t *c, struct colored_layout *cl, int width, int
902903

903904
// top layer (fill)
904905
cairo_matrix_t matrix;
905-
cairo_matrix_init_scale(&matrix, 1.0 / width, 1.0);
906+
cairo_matrix_init_scale(&matrix, 1.0 / progress_width_scaled, 1.0);
906907
cairo_pattern_set_matrix(COLOR(cl, highlight->pattern), &matrix);
907908
cairo_set_source(c, COLOR(cl, highlight->pattern));
908909

0 commit comments

Comments
 (0)