@@ -100,6 +100,11 @@ def __init__(
100100 )
101101
102102 def _add_outline (self ):
103+ """
104+ Blit the outline into the labels Bitmap. We will stamp self._stamp_source for each
105+ pixel of the foreground color but skip the foreground color when we blit.
106+ :return: None
107+ """
103108 if hasattr (self , "_stamp_source" ):
104109 for y in range (self .bitmap .height ):
105110 for x in range (self .bitmap .width ):
@@ -119,12 +124,6 @@ def _add_outline(self):
119124 "Try using either larger padding sizes, or smaller outline_size."
120125 ) from value_error
121126
122- # bitmaptools.blit(bitmap, stamp_source, x - size, y - size)
123- # for y_loc in range(-size, size+1):
124- # for x_loc in range(-size, size+1):
125- # if bitmap[x+x_loc, y+y_loc] != target_color_index:
126- # bitmap[x + x_loc, y + y_loc] = outline_color_index
127-
128127 def _place_text (
129128 self ,
130129 bitmap : Bitmap ,
@@ -136,6 +135,16 @@ def _place_text(
136135 # when copying glyph bitmaps (this is important for slanted text
137136 # where rectangular glyph boxes overlap)
138137 ) -> Tuple [int , int , int , int ]:
138+ """
139+ Copy the glpyphs that represent the value of the string into the labels Bitmap.
140+ :param bitmap: The bitmap to place text into
141+ :param text: The text to render
142+ :param font: The font to render the text in
143+ :param xposition: x location of the starting point within the bitmap
144+ :param yposition: y location of the starting point within the bitmap
145+ :param skip_index: Color index to skip during rendering instead of covering up
146+ :return Tuple bounding_box: tuple with x, y, width, height values of the bitmap
147+ """
139148 parent_result = super ()._place_text (
140149 bitmap , text , font , xposition , yposition , skip_index = skip_index
141150 )
0 commit comments