Fixed arc drawing bug for a non-whole number of degrees

This commit is contained in:
Andrew Murray 2019-08-06 20:03:38 +10:00
parent 6de118abd3
commit 8fff9a2444
3 changed files with 13 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 B

View File

@ -140,6 +140,18 @@ class TestImageDraw(PillowTestCase):
# Assert
self.assert_image_similar(im, Image.open(expected), 1)
def test_arc_width_non_whole_angle(self):
# Arrange
im = Image.new("RGB", (W, H))
draw = ImageDraw.Draw(im)
expected = "Tests/images/imagedraw_arc_width_non_whole_angle.png"
# Act
draw.arc(BBOX1, 10, 259.5, width=5)
# Assert
self.assert_image_similar(im, Image.open(expected), 1)
def test_bitmap(self):
# Arrange
small = Image.open("Tests/images/pil123rgba.png").resize((50, 50))

View File

@ -834,7 +834,7 @@ ellipse(Imaging im, int x0, int y0, int x1, int y1,
// Build edge list
// malloc check UNDONE, FLOAT?
maxEdgeCount = end - start;
maxEdgeCount = ceil(end - start);
if (inner) {
maxEdgeCount *= 2;
}