mirror of
				https://github.com/NoelFB/blah.git
				synced 2025-11-04 01:41:34 +08:00 
			
		
		
		
	added Rect::inflate(x, y)
This commit is contained in:
		@ -204,6 +204,7 @@ namespace Blah
 | 
				
			|||||||
		constexpr Rect scale(T s) const;
 | 
							constexpr Rect scale(T s) const;
 | 
				
			||||||
		constexpr Rect scale(T sx, T sy) const;
 | 
							constexpr Rect scale(T sx, T sy) const;
 | 
				
			||||||
		constexpr Rect inflate(T amount) const;
 | 
							constexpr Rect inflate(T amount) const;
 | 
				
			||||||
 | 
							constexpr Rect inflate(T amount_x, T amount_y) const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Rect Sectors:
 | 
							// Rect Sectors:
 | 
				
			||||||
		//		0101  0100  0110
 | 
							//		0101  0100  0110
 | 
				
			||||||
@ -794,6 +795,11 @@ namespace Blah
 | 
				
			|||||||
		return Rect(x - amount, y - amount, w + amount * 2, h + amount * 2);
 | 
							return Rect(x - amount, y - amount, w + amount * 2, h + amount * 2);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						template<class T>
 | 
				
			||||||
 | 
						constexpr Rect<T> Rect<T>::inflate(T amount_x, T amount_y) const {
 | 
				
			||||||
 | 
							return Rect(x - amount_x, y - amount_y, w + amount_x * 2, h + amount_y * 2);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	template<class T>
 | 
						template<class T>
 | 
				
			||||||
	constexpr u8 Rect<T>::get_sector(const Vec2<T>& pt) const
 | 
						constexpr u8 Rect<T>::get_sector(const Vec2<T>& pt) const
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user