Example #1
0
void LineBrush::BrushMove( const Point source, const Point target )
{
	ImpressionistDoc* pDoc = GetDocument();
	ImpressionistUI* dlg=pDoc->m_pUI;

	if ( pDoc == NULL ) {
		printf( "LineBrush::BrushMove  document is NULL\n" );
		return;
	}
	
	int size = pDoc->getSize();
	int ax,ay,bx,by;
	int alpha = pDoc->getAlpha(); 
	glEnable(GL_BLEND);
	glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
	double angle = pDoc->getStrokeAngle();
	glBegin( GL_LINES );
		SetColor( source, alpha );
		
		glVertex2d( target.x, target.y );
		glVertex2d( target.x + cos(angle)*size, target.y + sin(angle)*size );
		
	glEnd();
}