mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-27 09:44:31 +03:00
Merge pull request #4014 from radarhere/arc
Fixed arc drawing bug for a non-whole number of degrees
This commit is contained in:
commit
bd2d7cb247
BIN
Tests/images/imagedraw_arc_width_non_whole_angle.png
Normal file
BIN
Tests/images/imagedraw_arc_width_non_whole_angle.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 439 B |
|
@ -140,6 +140,18 @@ class TestImageDraw(PillowTestCase):
|
||||||
# Assert
|
# Assert
|
||||||
self.assert_image_similar(im, Image.open(expected), 1)
|
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):
|
def test_bitmap(self):
|
||||||
# Arrange
|
# Arrange
|
||||||
small = Image.open("Tests/images/pil123rgba.png").resize((50, 50))
|
small = Image.open("Tests/images/pil123rgba.png").resize((50, 50))
|
||||||
|
|
|
@ -834,7 +834,7 @@ ellipse(Imaging im, int x0, int y0, int x1, int y1,
|
||||||
|
|
||||||
// Build edge list
|
// Build edge list
|
||||||
// malloc check UNDONE, FLOAT?
|
// malloc check UNDONE, FLOAT?
|
||||||
maxEdgeCount = end - start;
|
maxEdgeCount = ceil(end - start);
|
||||||
if (inner) {
|
if (inner) {
|
||||||
maxEdgeCount *= 2;
|
maxEdgeCount *= 2;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user