From e97c26e893908243d16518e52cf9dec21ce93f3e Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 5 Jan 2021 20:26:55 +1100 Subject: [PATCH] Only draw each rectangle outline pixel once --- .../imagedraw_rectangle_translucent_outline.png | Bin 0 -> 235 bytes Tests/test_imagedraw.py | 15 +++++++++++++++ src/libImaging/Draw.c | 4 ++-- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 Tests/images/imagedraw_rectangle_translucent_outline.png diff --git a/Tests/images/imagedraw_rectangle_translucent_outline.png b/Tests/images/imagedraw_rectangle_translucent_outline.png new file mode 100644 index 0000000000000000000000000000000000000000..845648762ccab1e1d2047f653a9bb6bda4e22e65 GIT binary patch literal 235 zcmeAS@N?(olHy`uVBq!ia0vp^DImhline(im, x0, y0 + i, x1, ink); draw->hline(im, x0, y1 - i, x1, ink); - draw->line(im, x1 - i, y0, x1 - i, y1, ink); - draw->line(im, x0 + i, y1, x0 + i, y0, ink); + draw->line(im, x1 - i, y0 + width, x1 - i, y1 - width + 1, ink); + draw->line(im, x0 + i, y0 + width, x0 + i, y1 - width + 1, ink); } }