@@ -181,7 +181,7 @@ def draw_path(self, gc, path, transform, rgbFace=None):
181
181
poly_points = []
182
182
183
183
for point , code in path .iter_segments (transform ):
184
- logger .debug (point , code )
184
+ logger .debug (f" { point = } , { code = } " )
185
185
if code == Path .LINETO :
186
186
draw_func (self .surface , color , previous_point , point )
187
187
previous_point = point
@@ -239,6 +239,11 @@ def draw_image(self, gc, x, y, im):
239
239
)
240
240
241
241
def draw_text (self , gc , x , y , s , prop , angle , ismath = False , mtext = None ):
242
+
243
+ logger .info (
244
+ f"Drawing text: { s = } at ({ x = } , { y = } ) with { angle = } and ismath={ ismath } "
245
+ f"{ mtext = } { prop = } { gc = } "
246
+ )
242
247
# make sure font module is initialized
243
248
if not pygame .font .get_init ():
244
249
pygame .font .init ()
@@ -249,6 +254,9 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
249
254
font_surface = myfont .render (
250
255
s , gc .get_antialiased (), [val * 255 for val in gc .get_rgb ()]
251
256
)
257
+ if angle :
258
+ font_surface = pygame .transform .rotate (font_surface , angle )
259
+
252
260
# Get the expected size of the font
253
261
width , height = myfont .size (s )
254
262
# Tuple for the position of the font
@@ -311,6 +319,8 @@ def points_to_pixels(self, points):
311
319
# return points/72.0 * self.dpi.get()
312
320
313
321
def clear (self ):
322
+ if not hasattr (self , "surface" ):
323
+ return
314
324
self .surface .fill ("white" )
315
325
316
326
def copy_from_bbox (self , bbox ):
0 commit comments