mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 01:47:47 +03:00 
			
		
		
		
	Merge pull request #7881 from radarhere/rounded_rectangle
This commit is contained in:
		
						commit
						794a7d691f
					
				| 
						 | 
				
			
			@ -868,8 +868,10 @@ def test_rounded_rectangle_zero_radius(bbox: Coords) -> None:
 | 
			
		|||
    [
 | 
			
		||||
        ((20, 10, 80, 90), "x"),
 | 
			
		||||
        ((20, 10, 81, 90), "x_odd"),
 | 
			
		||||
        ((20, 10, 81.1, 90), "x_odd"),
 | 
			
		||||
        ((10, 20, 90, 80), "y"),
 | 
			
		||||
        ((10, 20, 90, 81), "y_odd"),
 | 
			
		||||
        ((10, 20, 90, 81.1), "y_odd"),
 | 
			
		||||
        ((20, 20, 80, 80), "both"),
 | 
			
		||||
    ],
 | 
			
		||||
)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -336,6 +336,10 @@ class ImageDraw:
 | 
			
		|||
 | 
			
		||||
        d = radius * 2
 | 
			
		||||
 | 
			
		||||
        x0 = round(x0)
 | 
			
		||||
        y0 = round(y0)
 | 
			
		||||
        x1 = round(x1)
 | 
			
		||||
        y1 = round(y1)
 | 
			
		||||
        full_x, full_y = False, False
 | 
			
		||||
        if all(corners):
 | 
			
		||||
            full_x = d >= x1 - x0 - 1
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user