示例#1
0
void Ball::draw ( wxBufferedDC& dc ) {
	wxSize size ( dc.GetTextExtent( n ) );
	
	#if NATIVEZOOMING
	double z = 1.0;
	#else
	double z = Billiard::zoom;
	#endif
	
	dc.SetBrush( wxBrush( color ) );
	//cout << "Disegno la pallina numero " << balls[i].num << ".\n";
	
	dc.DrawCircle ( pos.x * z, pos.y * z, RADIUS * z );
	
	if ( num ) {
		dc.SetBrush( wxBrush( *wxWHITE ) );
		dc.DrawCircle ( pos.x * z, pos.y * z, INNER * z );
		dc.DrawText ( n, pos.x * z - 0.5 * size.GetWidth(), pos.y * z - 0.5 * size.GetHeight() );
	}
}
void hdSimpleTextFigure::basicDrawSelected(wxBufferedDC &context, hdDrawingView *view)
{
	hdRect copy = displayBox().gethdRect(view->getIdx());
	view->CalcScrolledPosition(copy.x, copy.y, &copy.x, &copy.y);
	context.DrawText(getText(true), copy.GetPosition());
}