mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	Fix bug in rect.intersect(): empty rects beyond the first were
ignored instead of making the outcome empty...
This commit is contained in:
		
							parent
							
								
									e1f069ec98
								
							
						
					
					
						commit
						124eb94270
					
				
					 2 changed files with 18 additions and 16 deletions
				
			
		|  | @ -29,7 +29,8 @@ def intersect(list): | ||||||
| 	if is_empty(list[0]): return empty | 	if is_empty(list[0]): return empty | ||||||
| 	(left, top), (right, bottom) = list[0] | 	(left, top), (right, bottom) = list[0] | ||||||
| 	for rect in list[1:]: | 	for rect in list[1:]: | ||||||
| 		if not is_empty(rect): | 		if is_empty(rect): | ||||||
|  | 			return empty | ||||||
| 		(l, t), (r, b) = rect | 		(l, t), (r, b) = rect | ||||||
| 		if left < l: left = l | 		if left < l: left = l | ||||||
| 		if top < t: top = t | 		if top < t: top = t | ||||||
|  |  | ||||||
|  | @ -29,7 +29,8 @@ def intersect(list): | ||||||
| 	if is_empty(list[0]): return empty | 	if is_empty(list[0]): return empty | ||||||
| 	(left, top), (right, bottom) = list[0] | 	(left, top), (right, bottom) = list[0] | ||||||
| 	for rect in list[1:]: | 	for rect in list[1:]: | ||||||
| 		if not is_empty(rect): | 		if is_empty(rect): | ||||||
|  | 			return empty | ||||||
| 		(l, t), (r, b) = rect | 		(l, t), (r, b) = rect | ||||||
| 		if left < l: left = l | 		if left < l: left = l | ||||||
| 		if top < t: top = t | 		if top < t: top = t | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Guido van Rossum
						Guido van Rossum