Skip to content

Commit

Permalink
Scale offset according to DPI
Browse files Browse the repository at this point in the history
  • Loading branch information
livanh committed Feb 20, 2022
1 parent 329c877 commit 0a86f09
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -810,12 +810,12 @@ void calc_window_pos(const struct screen_info *scr, int width, int height, int *
case ORIGIN_TOP_LEFT:
case ORIGIN_LEFT_CENTER:
case ORIGIN_BOTTOM_LEFT:
*ret_x = scr->x + settings.offset.x;
*ret_x = scr->x + round(settings.offset.x * draw_get_scale());
break;
case ORIGIN_TOP_RIGHT:
case ORIGIN_RIGHT_CENTER:
case ORIGIN_BOTTOM_RIGHT:
*ret_x = scr->x + (scr->w - width) - settings.offset.x;
*ret_x = scr->x + (scr->w - width) - round(settings.offset.x * draw_get_scale());
break;
case ORIGIN_TOP_CENTER:
case ORIGIN_CENTER:
Expand All @@ -830,12 +830,12 @@ void calc_window_pos(const struct screen_info *scr, int width, int height, int *
case ORIGIN_TOP_LEFT:
case ORIGIN_TOP_CENTER:
case ORIGIN_TOP_RIGHT:
*ret_y = scr->y + settings.offset.y;
*ret_y = scr->y + round(settings.offset.y * draw_get_scale());
break;
case ORIGIN_BOTTOM_LEFT:
case ORIGIN_BOTTOM_CENTER:
case ORIGIN_BOTTOM_RIGHT:
*ret_y = scr->y + (scr->h - height) - settings.offset.y;
*ret_y = scr->y + (scr->h - height) - round(settings.offset.y * draw_get_scale());
break;
case ORIGIN_LEFT_CENTER:
case ORIGIN_CENTER:
Expand Down

0 comments on commit 0a86f09

Please sign in to comment.