FloatRect: add implicit IntRect conversion
This commit is contained in:
		
							parent
							
								
									73812e957e
								
							
						
					
					
						commit
						6c5745c4bf
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
					@ -183,6 +183,11 @@ struct FloatRect
 | 
				
			||||||
	    : x(r.x), y(r.y), w(r.w), h(r.h)
 | 
						    : x(r.x), y(r.y), w(r.w), h(r.h)
 | 
				
			||||||
	{}
 | 
						{}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						operator IntRect() const
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							return IntRect(x, y, w, h);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	Vec2 topLeft() const { return Vec2(x, y); }
 | 
						Vec2 topLeft() const { return Vec2(x, y); }
 | 
				
			||||||
	Vec2 bottomLeft() const { return Vec2(x, y+h); }
 | 
						Vec2 bottomLeft() const { return Vec2(x, y+h); }
 | 
				
			||||||
	Vec2 topRight() const { return Vec2(x+w, y); }
 | 
						Vec2 topRight() const { return Vec2(x+w, y); }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue