1
Fork 0
mirror of https://github.com/Steffo99/emblematic.git synced 2024-11-25 16:14:19 +00:00

Properly center icons with dimensions

This commit is contained in:
Steffo 2023-04-07 21:55:27 +02:00
parent 41a1ca8261
commit 55980863c3
Signed by: steffo
GPG key ID: 2A24051445686895

View file

@ -25,7 +25,7 @@ def compose_basic(background: bs4.Tag, icon: bs4.Tag, width: int, height: int) -
icon.attrs["width"] = "63%" icon.attrs["width"] = "63%"
icon.attrs["height"] = "63%" icon.attrs["height"] = "63%"
icon.attrs["preserveAspectRatio"] = "xMidYMid meet" 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""" doc = bs4.BeautifulSoup(f"""
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 {width} {height}"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 {width} {height}">