Skip to content

Commit

Permalink
Added HiDPI support to dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Limero committed Jul 3, 2018
1 parent ec2d83e commit 22112a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions render.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ void render(struct slurp_output *output) {
if (state->display_dimensions) {
cairo_select_font_face(cairo, "Sans", CAIRO_FONT_SLANT_NORMAL,
CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size(cairo, 14);
cairo_set_font_size(cairo, 14 * scale);
// buffer of 12 can hold selections up to 99999x99999
char dimensions[12];
snprintf(dimensions, sizeof(dimensions), "%ix%i", width, height);
cairo_move_to(cairo, x + width + 10, y + height + 20);
cairo_move_to(cairo, (x + width + 10) * scale, (y + height + 20) * scale);
cairo_show_text(cairo, dimensions);
}
}
Expand Down

0 comments on commit 22112a6

Please sign in to comment.