diff --git a/python_avatars/avatar.py b/python_avatars/avatar.py index d44d005..6b202ce 100644 --- a/python_avatars/avatar.py +++ b/python_avatars/avatar.py @@ -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' diff --git a/python_avatars/avatar_parts/clothes/graphic/custom_text.svg b/python_avatars/avatar_parts/clothes/graphic/custom_text.svg index 913b146..da8726c 100644 --- a/python_avatars/avatar_parts/clothes/graphic/custom_text.svg +++ b/python_avatars/avatar_parts/clothes/graphic/custom_text.svg @@ -1,8 +1,8 @@ - - - Hola! + + + Hola! \ No newline at end of file diff --git a/python_avatars/avatar_parts/clothes/graphic_shirt.svg b/python_avatars/avatar_parts/clothes/graphic_shirt.svg index 731558c..954d202 100644 --- a/python_avatars/avatar_parts/clothes/graphic_shirt.svg +++ b/python_avatars/avatar_parts/clothes/graphic_shirt.svg @@ -11,7 +11,7 @@ - + \ No newline at end of file