Skip to content

Commit

Permalink
Do not remove anchor when drawing multiline text
Browse files Browse the repository at this point in the history
I am not sure why this was done in the first place, maybe because support for it was only added in Pillow v8? This way, multiline text can properly be drawn if for example the text is fully centered.
  • Loading branch information
jhbruhn authored Oct 5, 2024
1 parent d451dc1 commit 149839a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions custom_components/open_epaper_link/imagegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ def customimage(entity_id, service, hass):
stroke_fill = element.get('stroke_fill', 'white')
if "max_width" in element:
text = get_wrapped_text(str(element['value']), font, line_length=element['max_width'])
anchor = None
else:
text = str(element['value'])
d.text((element['x'], akt_pos_y), text, fill=getIndexColor(color), font=font, anchor=anchor, align=align, spacing=spacing, stroke_width=stroke_width, stroke_fill=stroke_fill)
Expand Down Expand Up @@ -846,4 +845,4 @@ def rounded_corners(corner_string):
if corner in corner_map:
result[corner_map[corner]] = True

return tuple(result)
return tuple(result)

0 comments on commit 149839a

Please sign in to comment.