fix repr outside of class

This commit is contained in:
Jan Petykiewicz 2024-07-28 19:35:44 -07:00
parent 4c721feaec
commit d5adf57bc6

View File

@ -191,6 +191,11 @@ class Text(RotatableImpl, Shape):
return bounds
def __repr__(self) -> str:
rotation = f'{numpy.rad2deg(self.rotation):g}' if self.rotation != 0 else ''
mirrored = ' m{:d}' if self.mirrored else ''
return f'<TextShape "{self.string}" o{self.offset} h{self.height:g}{rotation}{mirrored}>'
def get_char_as_polygons(
font_path: str,
@ -278,8 +283,3 @@ def get_char_as_polygons(
polygons = path.to_polygons()
return polygons, advance
def __repr__(self) -> str:
rotation = f'{numpy.rad2deg(self.rotation):g}' if self.rotation != 0 else ''
mirrored = ' m{:d}' if self.mirrored else ''
return f'<TextShape "{self.string}" o{self.offset} h{self.height:g}{rotation}{mirrored}>'