@@ -190,7 +190,7 @@ def finalise(self,
190
190
if self .underlined :
191
191
self .font .underline_adjustment = 0.5
192
192
193
- surface = self ._draw_text (chunk_draw_height , chunk_draw_width ,
193
+ surface = self ._draw_text (chunk_draw_height , chunk_draw_width , text_shadow_width ,
194
194
chunk_x_origin , final_str_text , row_bg_height , row_chunk_origin )
195
195
196
196
target_surface = self ._finalise_horizontal_scroll (target_area ,
@@ -213,7 +213,7 @@ def _finalise_horizontal_scroll(self, target_area, text_shadow_width, x_scroll_o
213
213
target_surface , surface ):
214
214
# sort out horizontal scrolling
215
215
final_pos = (max (target_area .left , self .left - x_scroll_offset ),
216
- self .top - self .origin_row_y_adjust + text_shadow_width )
216
+ self .top - self .origin_row_y_adjust )
217
217
distance_to_lhs_overlap = self .left - target_area .left
218
218
lhs_overlap = max (0 , x_scroll_offset - distance_to_lhs_overlap )
219
219
remaining_rhs_space = target_area .width - (final_pos [0 ] - target_area .left )
@@ -264,11 +264,12 @@ def _handle_bg_selection_and_bg_drawing(self, size) -> pygame.Surface:
264
264
265
265
return surface
266
266
267
- def _handle_text_selection_and_text_drawing (self , final_str_text , chunk_draw_width , chunk_draw_height ,
268
- chunk_x_origin , row_chunk_origin ) -> pygame .Surface :
267
+ def _handle_text_selection_and_text_drawing (self , final_str_text , chunk_draw_width , text_shadow_width ,
268
+ chunk_draw_height , chunk_x_origin , row_chunk_origin ) -> pygame .Surface :
269
269
text_surface : pygame .Surface = self .font .render_premul_to (final_str_text , Color ('#FFFFFFFF' ),
270
270
surf_size = (chunk_draw_width , chunk_draw_height ),
271
- surf_position = (chunk_x_origin , row_chunk_origin ))
271
+ surf_position = (chunk_x_origin ,
272
+ row_chunk_origin + text_shadow_width ))
272
273
273
274
if (self .selection_rect is not None
274
275
and (self .selection_rect .width != 0 or self .selection_rect .height != 0 )
@@ -301,11 +302,11 @@ def _handle_text_selection_and_text_drawing(self, final_str_text, chunk_draw_wid
301
302
302
303
return text_surface
303
304
304
- def _draw_text (self , chunk_draw_height , chunk_draw_width , chunk_x_origin ,
305
+ def _draw_text (self , chunk_draw_height , chunk_draw_width , text_shadow_width , chunk_x_origin ,
305
306
final_str_text , row_bg_height , row_chunk_origin ):
306
307
307
- text_surface = self ._handle_text_selection_and_text_drawing (final_str_text , chunk_draw_width , chunk_draw_height ,
308
- chunk_x_origin , row_chunk_origin )
308
+ text_surface = self ._handle_text_selection_and_text_drawing (final_str_text , chunk_draw_width , text_shadow_width ,
309
+ chunk_draw_height , chunk_x_origin , row_chunk_origin )
309
310
310
311
surface = self ._handle_bg_selection_and_bg_drawing ((chunk_draw_width , row_bg_height ))
311
312
# center the text in the line
@@ -319,7 +320,7 @@ def _draw_text(self, chunk_draw_height, chunk_draw_width, chunk_x_origin,
319
320
text_rect .centery = surface .get_rect ().centery
320
321
# apply any shadow effects
321
322
self ._apply_shadow_effect (surface , text_rect , final_str_text ,
322
- text_surface , (chunk_x_origin , row_chunk_origin ))
323
+ text_surface , (chunk_x_origin , row_chunk_origin + text_shadow_width ))
323
324
surface .blit (text_surface , text_rect , special_flags = BLEND_PREMULTIPLIED )
324
325
return surface
325
326
0 commit comments