diff options
Diffstat (limited to 'sources/TZR_DrawEnd.c')
-rw-r--r-- | sources/TZR_DrawEnd.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sources/TZR_DrawEnd.c b/sources/TZR_DrawEnd.c index c5449e1..a1d09da 100644 --- a/sources/TZR_DrawEnd.c +++ b/sources/TZR_DrawEnd.c @@ -20,17 +20,18 @@ pixel_draw_end(void) win_w = win_w ? win_w : 1; win_h = win_h ? win_h : 1; - const float ratio_w = win_w / (float)___tzr_config.width; + const int width = ___tzr_config.width * ___tzr_config.ratio; + const float ratio_w = win_w / (float)(width); const float ratio_h = win_h / (float)___tzr_config.height; ___tzr_scale = (ratio_w < ratio_h) ? ratio_w : ratio_h; if (___tzr_scale > 1.0f && ___tzr_config.pixel_perfect) ___tzr_scale = (int)___tzr_scale; - ___tzr_off_x = (win_w - ___tzr_config.width * ___tzr_scale) / 2; + ___tzr_off_x = (win_w - width * ___tzr_scale) / 2; ___tzr_off_y = (win_h - ___tzr_config.height * ___tzr_scale) / 2; const SDL_Rect dest = { ___tzr_off_x, ___tzr_off_y, - ___tzr_config.width * ___tzr_scale, + width * ___tzr_scale, ___tzr_config.height * ___tzr_scale }; |