keep gradient direction; use const ref

This commit is contained in:
Vogel, Rick 2024-01-29 16:47:19 +01:00
parent b511ed16c3
commit 1685ba6ece
1 changed files with 2 additions and 3 deletions

View File

@ -55,7 +55,7 @@ QColor extracted( const QColor& from, const QColor& to, qreal ratio )
QskGradient extracted( const QskGradient& gradient, qreal from, qreal to ) QskGradient extracted( const QskGradient& gradient, qreal from, qreal to )
{ {
const auto stops = gradient.stops(); const auto& stops = gradient.stops();
if ( stops.count() == 0 ) if ( stops.count() == 0 )
{ {
@ -108,8 +108,7 @@ QskGradient extracted( const QskGradient& gradient, qreal from, qreal to )
return extracted( stops[ toIndex.first ].color(), stops[ toIndex.second ].color(), p ); return extracted( stops[ toIndex.first ].color(), stops[ toIndex.second ].color(), p );
}(); }();
QskGradient newGradient; QskGradient newGradient = gradient;
newGradient.setLinearDirection( Qt::Horizontal );
QskGradientStops newStops; QskGradientStops newStops;
newStops << QskGradientStop{ 0.0, fromColor }; newStops << QskGradientStop{ 0.0, fromColor };