From 405e0320c4f2dc80790a52ed1812b59ebe8d8ec2 Mon Sep 17 00:00:00 2001 From: trigg Date: Mon, 5 Oct 2020 16:44:21 +0100 Subject: [PATCH] - Don't adjust ratio if not needed --- discover_overlay/image_getter.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/discover_overlay/image_getter.py b/discover_overlay/image_getter.py index 5fcc6b7..bdac51e 100644 --- a/discover_overlay/image_getter.py +++ b/discover_overlay/image_getter.py @@ -137,8 +137,11 @@ def draw_img_to_rect(img, ctx, x, y, w, h, path=False, aspect=False, anchor=0, h ctx.save() px = img.get_width() py = img.get_height() - (x_off, y_off, w, h) = get_aspected_size( - img, w, h, anchor=anchor, hanchor=hanchor) + x_off = 0 + y_off = 0 + if aspect: + (x_off, y_off, w, h) = get_aspected_size( + img, w, h, anchor=anchor, hanchor=hanchor) ctx.translate(x + x_off, y + y_off) ctx.scale(w, h)