| 
									
										
										
										
											2018-04-21 21:24:46 +08:00
										 |  |  | #include "..\..\e2dshape.h"
 | 
					
						
							| 
									
										
										
										
											2018-04-02 23:01:38 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | e2d::Rect::Rect() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | e2d::Rect::Rect(double width, double height) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	this->setSize(width, height); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | e2d::Rect::Rect(Size size) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	this->setSize(size); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | e2d::Rect::Rect(double top, double left, double width, double height) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	this->setPivot(0, 0); | 
					
						
							|  |  |  | 	this->setPos(top, left); | 
					
						
							|  |  |  | 	this->setSize(width, height); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | e2d::Rect::Rect(Point topLeft, Size size) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	this->setPivot(0, 0); | 
					
						
							|  |  |  | 	this->setPos(topLeft); | 
					
						
							|  |  |  | 	this->setSize(size); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | e2d::Rect::~Rect() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void e2d::Rect::_renderLine() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	Renderer::getRenderTarget()->DrawRectangle( | 
					
						
							| 
									
										
										
										
											2018-05-08 17:40:36 +08:00
										 |  |  | 		D2D1::RectF(0, 0, _fWidth, _fHeight), | 
					
						
							| 
									
										
										
										
											2018-04-02 23:01:38 +08:00
										 |  |  | 		Renderer::getSolidColorBrush(), | 
					
						
							| 
									
										
										
										
											2018-05-08 17:40:36 +08:00
										 |  |  | 		_fStrokeWidth | 
					
						
							| 
									
										
										
										
											2018-04-02 23:01:38 +08:00
										 |  |  | 	); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void e2d::Rect::_renderFill() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	Renderer::getRenderTarget()->FillRectangle( | 
					
						
							| 
									
										
										
										
											2018-05-08 17:40:36 +08:00
										 |  |  | 		D2D1::RectF(0, 0, _fWidth, _fHeight), | 
					
						
							| 
									
										
										
										
											2018-04-02 23:01:38 +08:00
										 |  |  | 		Renderer::getSolidColorBrush() | 
					
						
							|  |  |  | 	); | 
					
						
							|  |  |  | } |