color filter: Leave original brush as it was when substituting colors

QBrush is explicitly shared, so when setting the gradient of a copy,
we are also changing the gradient of the original.
This commit is contained in:
Peter Hartmann 2023-04-03 13:38:20 +02:00
parent f5548fd704
commit 78a9d911ce
1 changed files with 4 additions and 4 deletions

View File

@ -56,10 +56,10 @@ static inline QBrush qskSubstitutedBrush(
if ( isModified ) if ( isModified )
{ {
newBrush = brush; auto newGradient = *gradient;
newGradient.setStops( stops );
auto newGradient = const_cast< QGradient* >( newBrush.gradient() ); newBrush = QBrush( newGradient );
newGradient->setStops( stops ); newBrush.setTransform( brush.transform() );
} }
} }
else else