QskBoxBorderColors interpolation fixed

This commit is contained in:
Uwe Rathmann 2022-10-31 17:35:13 +01:00
parent ad67d035f3
commit 4c73c1fd7b
2 changed files with 6 additions and 5 deletions

View File

@ -188,8 +188,8 @@ QskBoxBorderColors QskBoxBorderColors::interpolated(
the color and use always use the other color. TODO ... the color and use always use the other color. TODO ...
*/ */
#endif #endif
auto& gradient = colors.m_gradients[ i ]; colors.m_gradients[ i ] =
gradient = gradient.interpolated( to.m_gradients[ i ], ratio ); m_gradients[ i ].interpolated( to.m_gradients[ i ], ratio );
} }
return colors; return colors;

View File

@ -319,9 +319,10 @@ QskGradient QskGradient::interpolated( const QskGradient& to, qreal ratio ) cons
gradient = to; gradient = to;
gradient.setStops( qskInterpolatedGradientStops( const auto stops = qskInterpolatedGradientStops(
m_stops, isMonochrome(), m_stops, isMonochrome(), to.m_stops, to.isMonochrome(), ratio );
to.m_stops, to.isMonochrome(), ratio ) );
gradient.setStops( stops );
for ( uint i = 0; i < sizeof( m_values ) / sizeof( m_values[0] ); i++ ) for ( uint i = 0; i < sizeof( m_values ) / sizeof( m_values[0] ); i++ )
gradient.m_values[i] = m_values[i] + ratio * ( to.m_values[i] - m_values[i] ); gradient.m_values[i] = m_values[i] + ratio * ( to.m_values[i] - m_values[i] );