Pillow icon indicating copy to clipboard operation
Pillow copied to clipboard

Round box position to integer when pasting embedded color

Open radarhere opened this issue 3 years ago • 1 comments

Resolves #6515

If align="center" is used for multiline_text, https://github.com/python-pillow/Pillow/blob/4c59f77e37e7333544a5d0910de8148f7972ed06/src/PIL/ImageDraw.py#L562-L570 then coord can be a float for the embedded_color paste. But when pasting one image onto another, the co-ordinates must be integers, and so an error will be raised, as in the issue. https://github.com/python-pillow/Pillow/blob/4c59f77e37e7333544a5d0910de8148f7972ed06/src/PIL/ImageDraw.py#L486

This PR rounds the co-ordinates to integers in that case.

radarhere avatar Aug 22 '22 02:08 radarhere

I've created https://github.com/radarhere/Pillow/pull/18 with a few suggestions.

nulano avatar Aug 24 '22 21:08 nulano