Example #1
0
void Line::render( Gdiplus::Graphics *graphics, float currentY, float xBorder, float maxWidth )
{
	float currentX = xBorder;
	if( mJustification == CENTERED )
		currentX = ( maxWidth - mWidth ) / 2.0f;
	else if( mJustification == RIGHT )
		currentX = maxWidth - mWidth - xBorder;
	for( vector<Run>::const_iterator runIt = mRuns.begin(); runIt != mRuns.end(); ++runIt ) {
		const Gdiplus::Font *font = runIt->mFont.getGdiplusFont();;
		ColorA8u nativeColor( runIt->mColor );
		Gdiplus::SolidBrush brush( Gdiplus::Color( nativeColor.a, nativeColor.r, nativeColor.g, nativeColor.b ) );
		graphics->DrawString( &runIt->mWideText[0], -1, font, Gdiplus::PointF( currentX, currentY + (mAscent - runIt->mAscent) ), &brush );
		currentX += runIt->mWidth;
	}
}
Example #2
0
void fill( SurfaceT<T> *surface, const ColorAT<Y> &color, const Area &area )
{
	ColorAT<T> nativeColor( color );
	fill_impl( surface, nativeColor, area );
}
Example #3
0
void fill( SurfaceT<T> *surface, const ColorAT<Y> &color )
{
	ColorAT<T> nativeColor( color );
	fill_impl( surface, nativeColor, surface->getBounds() );
}