From c04056f1062407fc0abca489c210d031fd3fa394 Mon Sep 17 00:00:00 2001 From: Goutham Pacha Ravi Date: Wed, 20 Jun 2018 18:26:10 -0700 Subject: [PATCH] Fix width of team badges svg Use the max width of all rows to determine width of the svg generated, rather than taking the last element's width; this will work regardless of whether there are 4 badges in the last row. Change-Id: Ibc427bca0acdab119c0c2b358bba04eec7418327 --- doc/source/_exts/badges.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/source/_exts/badges.py b/doc/source/_exts/badges.py index d36880376..9f90b1e60 100644 --- a/doc/source/_exts/badges.py +++ b/doc/source/_exts/badges.py @@ -185,7 +185,8 @@ def _generate_teams_badges(app, exception=None): badges = _organize_badges(_generate_tag_badges(tags)) svg = '\n'.join(_to_svg(chain(*badges))) - root_width = badges[-1][-1]['svg_x'] + badges[-1][-1]['width'] + root_width = max([bdg_row[-1]['width'] + bdg_row[-1]['svg_x'] + for bdg_row in badges]) root_height = badges[-1][0]['svg_y'] + badges[-1][0]['height'] for repo in deliverable.get('repos', []):