Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
Commit 605859c
  • Loading branch information
jirutka committed Nov 29, 2023
2 parents 1307d7b + 605859c commit 282d876
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions background-image.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,14 @@ void render_background_image(cairo_t *cairo, cairo_surface_t *image,
break;
}
case BACKGROUND_MODE_CENTER:
/*
* Align the unscaled image to integer pixel boundaries
* in order to prevent loss of clarity (this only matters
* for odd-sized images).
*/
cairo_set_source_surface(cairo, image,
(double)buffer_width / 2 - width / 2,
(double)buffer_height / 2 - height / 2);
(int)((double)buffer_width / 2 - width / 2),
(int)((double)buffer_height / 2 - height / 2));
break;
case BACKGROUND_MODE_TILE: {
cairo_pattern_t *pattern = cairo_pattern_create_for_surface(image);
Expand Down

0 comments on commit 282d876

Please sign in to comment.