From 55980863c38070d0bcae6fb7ced54e068fa35271 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 7 Apr 2023 21:55:27 +0200 Subject: [PATCH] Properly center icons with dimensions --- emblematic/compose.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emblematic/compose.py b/emblematic/compose.py index a0d0ca2..8c58eb6 100644 --- a/emblematic/compose.py +++ b/emblematic/compose.py @@ -25,7 +25,7 @@ def compose_basic(background: bs4.Tag, icon: bs4.Tag, width: int, height: int) - icon.attrs["width"] = "63%" icon.attrs["height"] = "63%" icon.attrs["preserveAspectRatio"] = "xMidYMid meet" - icon.attrs["transform"] = f"translate({width * 0.37}, {height * 0.37})" + icon.attrs["transform"] = f"translate({width * 0.37 / 2}, {height * 0.37 / 2})" doc = bs4.BeautifulSoup(f"""