Skip to content

Commit

Permalink
Center shirt text (solves issue #2)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibonn committed Jan 22, 2023
1 parent 7f092f3 commit 5183d25
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions python_avatars/avatar.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ def render(self, path=None):
graphic.get_element_by_id(
'Graphic-Text'
).children('tspan')[0].set_content(self.shirt_text)
else:
# Apply transform to graphic elements (see issue #2 for details)
graphic_id = '-'.join([x.capitalize() for x in self.shirt_graphic.name.split('_')])
graphic.get_element_by_id(f"Clothing/Graphic/{graphic_id}").set_attr('transform', 'translate(77.000000, 58.000000)')

clothes.get_element_by_id(
'Graphic'
Expand Down
6 changes: 3 additions & 3 deletions python_avatars/avatar_parts/clothes/graphic/custom_text.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion python_avatars/avatar_parts/clothes/graphic_shirt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5183d25

Please sign in to comment.