| 
									
										
										
										
											2017-09-10 23:56:52 +08:00
										 |  |  |  | #include "..\..\Easy2d.h"
 | 
					
						
							|  |  |  |  | #include "..\..\EasyX\easyx.h"
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-12 12:53:34 +08:00
										 |  |  |  | Shape::Shape() : | 
					
						
							|  |  |  |  | 	lineColor(Color::black), | 
					
						
							|  |  |  |  | 	fillColor(Color::white) | 
					
						
							| 
									
										
										
										
											2017-09-10 23:56:52 +08:00
										 |  |  |  | { | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | Shape::~Shape() | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | void Shape::_onDraw() | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  | 	// <20><>״<EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>ʾ
 | 
					
						
							|  |  |  |  | 	if (!m_bDisplay)  | 
					
						
							|  |  |  |  | 	{ | 
					
						
							|  |  |  |  | 		return; | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 	// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
 | 
					
						
							|  |  |  |  | 	setlinecolor(lineColor); | 
					
						
							|  |  |  |  | 	setfillcolor(fillColor); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״<EFBFBD><D7B4><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD>в<EFBFBD>ͬ<EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD>
 | 
					
						
							|  |  |  |  | 	if (_style == Shape::STYLE::round)  | 
					
						
							|  |  |  |  | 	{ | 
					
						
							|  |  |  |  | 		roundShape(); | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 	else if (_style == Shape::STYLE::solid)  | 
					
						
							|  |  |  |  | 	{ | 
					
						
							|  |  |  |  | 		solidShape(); | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | 	else if (_style == Shape::STYLE::fill)  | 
					
						
							|  |  |  |  | 	{ | 
					
						
							|  |  |  |  | 		fillShape(); | 
					
						
							|  |  |  |  | 	} | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | inline COLORREF Shape::getFillColor() const | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  | 	return fillColor; | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | inline COLORREF Shape::getLineColor() const | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  | 	return lineColor; | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | void Shape::setFillColor(COLORREF color) | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  | 	fillColor = color; | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | void Shape::setLineColor(COLORREF color) | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  | 	lineColor = color; | 
					
						
							|  |  |  |  | } |