@@ -190,23 +190,35 @@ def _update_background_color(self, new_color):
190
190
)
191
191
lines = self .text .count ("\n " ) + 1
192
192
193
- if not self ._added_background_tilegrid : # no bitmap is in the self Group
193
+ if not self ._added_background_tilegrid : # no bitmap is in the self Group
194
194
# add bitmap if text is present and bitmap sizes > 0 pixels
195
- if ((len (self ._text ) > 0 )
196
- and (self ._boundingbox [2 ] + self ._padding_left + self ._padding_right > 0 )
197
- and (self ._boundingbox [3 ] + self ._padding_top + self ._padding_bottom > 0 )):
195
+ if (
196
+ (len (self ._text ) > 0 )
197
+ and (
198
+ self ._boundingbox [2 ] + self ._padding_left + self ._padding_right > 0
199
+ )
200
+ and (
201
+ self ._boundingbox [3 ] + self ._padding_top + self ._padding_bottom > 0
202
+ )
203
+ ):
198
204
if len (self ) > 0 :
199
205
self .insert (0 , self ._create_background_box (lines , y_offset ))
200
206
else :
201
207
self .append (self ._create_background_box (lines , y_offset ))
202
208
self ._added_background_tilegrid = True
203
- else : # a bitmap is present in the self Group
209
+ else : # a bitmap is present in the self Group
204
210
# update bitmap if text is present and bitmap sizes > 0 pixels
205
- if ((len (self ._text ) > 0 )
206
- and (self ._boundingbox [2 ] + self ._padding_left + self ._padding_right > 0 )
207
- and (self ._boundingbox [3 ] + self ._padding_top + self ._padding_bottom > 0 )):
211
+ if (
212
+ (len (self ._text ) > 0 )
213
+ and (
214
+ self ._boundingbox [2 ] + self ._padding_left + self ._padding_right > 0
215
+ )
216
+ and (
217
+ self ._boundingbox [3 ] + self ._padding_top + self ._padding_bottom > 0
218
+ )
219
+ ):
208
220
self [0 ] = self ._create_background_box (lines , y_offset )
209
- else : # delete the existing bitmap
221
+ else : # delete the existing bitmap
210
222
self .pop (0 )
211
223
self ._added_background_tilegrid = False
212
224
0 commit comments