mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 09:57:43 +03:00 
			
		
		
		
	Added test for #5432
This commit is contained in:
		
							parent
							
								
									0c9ffcfa14
								
							
						
					
					
						commit
						ca67a0c1a2
					
				| 
						 | 
				
			
			@ -538,6 +538,36 @@ def test_pieslice_wide():
 | 
			
		|||
    assert_image_equal_tofile(im, "Tests/images/imagedraw_pieslice_wide.png")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def test_pieslice_no_spikes():
 | 
			
		||||
    im = Image.new("RGB", (161, 161), "white")
 | 
			
		||||
    draw = ImageDraw.Draw(im)
 | 
			
		||||
    cxs = (
 | 
			
		||||
        [140] * 3
 | 
			
		||||
        + list(range(140, 19, -20))
 | 
			
		||||
        + [20] * 5
 | 
			
		||||
        + list(range(20, 141, 20))
 | 
			
		||||
        + [140] * 2
 | 
			
		||||
    )
 | 
			
		||||
    cys = (
 | 
			
		||||
        list(range(80, 141, 20))
 | 
			
		||||
        + [140] * 5
 | 
			
		||||
        + list(range(140, 19, -20))
 | 
			
		||||
        + [20] * 5
 | 
			
		||||
        + list(range(20, 80, 20))
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    for cx, cy, angle in zip(cxs, cys, range(0, 360, 15)):
 | 
			
		||||
        draw.pieslice(
 | 
			
		||||
            [cx - 100, cy - 100, cx + 100, cy + 100], angle, angle + 1, fill="black"
 | 
			
		||||
        )
 | 
			
		||||
        draw.point([cx, cy], fill="red")
 | 
			
		||||
 | 
			
		||||
    im_pre_erase = im.copy()
 | 
			
		||||
    draw.rectangle([21, 21, 139, 139], fill="white")
 | 
			
		||||
 | 
			
		||||
    assert_image_equal(im, im_pre_erase)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def helper_point(points):
 | 
			
		||||
    # Arrange
 | 
			
		||||
    im = Image.new("RGB", (W, H))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user