| 
									
										
										
										
											2018-04-21 21:24:46 +08:00
										 |  |  | #include "..\..\e2dshape.h"
 | 
					
						
							| 
									
										
										
										
											2018-04-02 23:01:38 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | e2d::Rect::Rect() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-17 12:22:52 +08:00
										 |  |  | e2d::Rect::Rect(Size size) | 
					
						
							| 
									
										
										
										
											2018-04-02 23:01:38 +08:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-05-17 12:22:52 +08:00
										 |  |  | 	this->setSize(size); | 
					
						
							| 
									
										
										
										
											2018-04-02 23:01:38 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-17 12:22:52 +08:00
										 |  |  | e2d::Rect::Rect(Point topLeft, Size size) | 
					
						
							| 
									
										
										
										
											2018-04-02 23:01:38 +08:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-05-17 12:22:52 +08:00
										 |  |  | 	this->setPivot(0, 0); | 
					
						
							|  |  |  | 	this->setPos(topLeft); | 
					
						
							| 
									
										
										
										
											2018-04-02 23:01:38 +08:00
										 |  |  | 	this->setSize(size); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-17 12:22:52 +08:00
										 |  |  | e2d::Rect * e2d::Rect::create() | 
					
						
							| 
									
										
										
										
											2018-04-02 23:01:38 +08:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-05-17 12:22:52 +08:00
										 |  |  | 	return Create<Rect>(); | 
					
						
							| 
									
										
										
										
											2018-04-02 23:01:38 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-17 12:22:52 +08:00
										 |  |  | e2d::Rect * e2d::Rect::create(Size size) | 
					
						
							| 
									
										
										
										
											2018-04-02 23:01:38 +08:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-05-17 12:22:52 +08:00
										 |  |  | 	return Create<Rect>(size); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | e2d::Rect * e2d::Rect::create(Point topLeft, Size size) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	return Create<Rect>(topLeft, size); | 
					
						
							| 
									
										
										
										
											2018-04-02 23:01:38 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | e2d::Rect::~Rect() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void e2d::Rect::_renderLine() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	Renderer::getRenderTarget()->DrawRectangle( | 
					
						
							| 
									
										
										
										
											2018-05-09 00:34:15 +08:00
										 |  |  | 		D2D1::RectF(0, 0, _width, _height), | 
					
						
							| 
									
										
										
										
											2018-04-02 23:01:38 +08:00
										 |  |  | 		Renderer::getSolidColorBrush(), | 
					
						
							| 
									
										
										
										
											2018-05-09 00:34:15 +08:00
										 |  |  | 		_strokeWidth | 
					
						
							| 
									
										
										
										
											2018-04-02 23:01:38 +08:00
										 |  |  | 	); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void e2d::Rect::_renderFill() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	Renderer::getRenderTarget()->FillRectangle( | 
					
						
							| 
									
										
										
										
											2018-05-09 00:34:15 +08:00
										 |  |  | 		D2D1::RectF(0, 0, _width, _height), | 
					
						
							| 
									
										
										
										
											2018-04-02 23:01:38 +08:00
										 |  |  | 		Renderer::getSolidColorBrush() | 
					
						
							|  |  |  | 	); | 
					
						
							|  |  |  | } |