Revert "We don't need this commit either"
This reverts commit 2dc38064f7fee1d0505262fe5cebcf9e1fb16cea.
This commit is contained in:
parent
c16eaa48bd
commit
7cbd5d8cb8
|
@ -44,34 +44,20 @@ namespace QskVertex
|
||||||
class ColorMapGradient
|
class ColorMapGradient
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
inline ColorMapGradient( const QskGradient& gradient )
|
inline ColorMapGradient( Color color1, Color color2 )
|
||||||
: m_gradient( gradient )
|
: m_color1( color1 )
|
||||||
|
, m_color2( color2 )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Color colorAt( qreal ratio ) const
|
inline Color colorAt( qreal value ) const
|
||||||
{
|
{
|
||||||
const auto stops = m_gradient.stops();
|
return m_color1.interpolatedTo( m_color2, value );
|
||||||
|
|
||||||
for( int i = 0; i < m_gradient.stopCount(); ++i )
|
|
||||||
{
|
|
||||||
const QskGradientStop stop = stops.at( i );
|
|
||||||
|
|
||||||
if( stop.position() >= ratio )
|
|
||||||
{
|
|
||||||
const int start = ( i == 0 ) ? 0 : i - 1;
|
|
||||||
const int end = ( i == 0 ) ? 1 : i;
|
|
||||||
const QColor color = QskGradientStop::interpolated( stops.at( start ),
|
|
||||||
stops.at( end ), ratio );
|
|
||||||
return Color( color );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return Color();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const QskGradient m_gradient;
|
const Color m_color1;
|
||||||
|
const Color m_color2;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ColorIterator
|
class ColorIterator
|
||||||
|
|
|
@ -902,7 +902,7 @@ static inline void qskRenderFillRandom(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const ColorMapGradient map( gradient );
|
const ColorMapGradient map( gradient.startColor(), gradient.endColor() );
|
||||||
qskRenderFillLines( metrics, orientation, line, map );
|
qskRenderFillLines( metrics, orientation, line, map );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -926,7 +926,7 @@ static inline void qskRenderBoxRandom(
|
||||||
{
|
{
|
||||||
const auto orientation = qskQtOrientation( gradient );
|
const auto orientation = qskQtOrientation( gradient );
|
||||||
|
|
||||||
const ColorMapGradient fillMap( gradient );
|
const ColorMapGradient fillMap( gradient.startColor(), gradient.endColor() );
|
||||||
qskRenderLines( metrics, orientation, borderLine, borderMap, fillLine, fillMap );
|
qskRenderLines( metrics, orientation, borderLine, borderMap, fillLine, fillMap );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -948,7 +948,7 @@ static inline void qskRenderBoxRandom(
|
||||||
{
|
{
|
||||||
const auto orientation = qskQtOrientation( gradient );
|
const auto orientation = qskQtOrientation( gradient );
|
||||||
|
|
||||||
const ColorMapGradient fillMap( gradient );
|
const ColorMapGradient fillMap( gradient.startColor(), gradient.endColor() );
|
||||||
qskRenderLines( metrics, orientation, borderLine, tl, tr, bl, br, fillLine, fillMap );
|
qskRenderLines( metrics, orientation, borderLine, tl, tr, bl, br, fillLine, fillMap );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -604,7 +604,7 @@ void QskBoxRenderer::renderRect(
|
||||||
|
|
||||||
if ( fillRandom )
|
if ( fillRandom )
|
||||||
{
|
{
|
||||||
const ColorMapGradient colorMap( { Qt::Vertical, gd.startColor(), gd.endColor() } );
|
const ColorMapGradient colorMap( gd.startColor(), gd.endColor() );
|
||||||
qskCreateFillRandom( gd.orientation(), in, colorMap, line );
|
qskCreateFillRandom( gd.orientation(), in, colorMap, line );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue