mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
Fixed arc drawing bug for a non-whole number of degrees
This commit is contained in:
parent
6de118abd3
commit
8fff9a2444
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
|
||||
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))
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user