mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-03 00:04:47 -04:00
gradient along path when type is fluid
This commit is contained in:
parent
620db939b8
commit
5a121ceb95
@ -121,10 +121,20 @@ void QgsModelArrowItem::paint( QPainter *painter, const QStyleOptionGraphicsItem
|
||||
|
||||
// Set the painter back to regular stroke thickness
|
||||
p = pen();
|
||||
p.setColor( color );
|
||||
QColor endColor = mEndItem->getLinkColor( mEndEdge, mEndIndex );
|
||||
color.setAlpha( 255 );
|
||||
|
||||
QLinearGradient gradient;
|
||||
QPointF startPoint = path().pointAtPercent( 0.0 );
|
||||
QPointF endPoint = path().pointAtPercent( 1.0 );
|
||||
gradient.setStart( startPoint );
|
||||
gradient.setFinalStop( endPoint );
|
||||
gradient.setColorAt( 0, color );
|
||||
gradient.setColorAt( 1, endColor );
|
||||
|
||||
p.setBrush( QBrush( gradient ) );
|
||||
p.setWidth( 2 );
|
||||
painter->setPen( p );
|
||||
|
||||
painter->drawPath( path() );
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user