code duplication removed
This commit is contained in:
parent
2ef09e3f02
commit
15102be421
@ -704,6 +704,11 @@ namespace
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline Qt::Orientation qskQtOrientation( const QskGradient& gradient )
|
||||||
|
{
|
||||||
|
return ( gradient.orientation() == QskGradient::Vertical ) ? Qt::Vertical : Qt::Horizontal;
|
||||||
|
}
|
||||||
|
|
||||||
static inline int qskFillLineCount(
|
static inline int qskFillLineCount(
|
||||||
const QskBoxRenderer::Metrics& metrics, const QskGradient& gradient )
|
const QskBoxRenderer::Metrics& metrics, const QskGradient& gradient )
|
||||||
{
|
{
|
||||||
@ -872,8 +877,7 @@ static inline void qskRenderFillRandom(
|
|||||||
const QskBoxRenderer::Metrics& metrics,
|
const QskBoxRenderer::Metrics& metrics,
|
||||||
const QskGradient& gradient, ColoredLine* line )
|
const QskGradient& gradient, ColoredLine* line )
|
||||||
{
|
{
|
||||||
const auto orientation =
|
const auto orientation = qskQtOrientation( gradient );
|
||||||
( gradient.orientation() == QskGradient::Vertical ) ? Qt::Vertical : Qt::Horizontal;
|
|
||||||
|
|
||||||
if ( gradient.isMonochrome() )
|
if ( gradient.isMonochrome() )
|
||||||
{
|
{
|
||||||
@ -904,8 +908,7 @@ static inline void qskRenderBoxRandom(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const auto orientation = ( gradient.orientation() == QskGradient::Vertical )
|
const auto orientation = qskQtOrientation( gradient );
|
||||||
? Qt::Vertical : Qt::Horizontal;
|
|
||||||
|
|
||||||
const ColorMapGradient fillMap( gradient.startColor(), gradient.endColor() );
|
const ColorMapGradient fillMap( gradient.startColor(), gradient.endColor() );
|
||||||
qskRenderLines( metrics, orientation, borderLine, borderMap, fillLine, fillMap );
|
qskRenderLines( metrics, orientation, borderLine, borderMap, fillLine, fillMap );
|
||||||
@ -927,8 +930,7 @@ static inline void qskRenderBoxRandom(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const auto orientation = ( gradient.orientation() == QskGradient::Vertical )
|
const auto orientation = qskQtOrientation( gradient );
|
||||||
? Qt::Vertical : Qt::Horizontal;
|
|
||||||
|
|
||||||
const ColorMapGradient fillMap( gradient.startColor(), gradient.endColor() );
|
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 );
|
||||||
@ -1283,9 +1285,7 @@ void QskBoxRenderer::renderRectellipse( const QRectF& rect,
|
|||||||
if ( extraLine )
|
if ( extraLine )
|
||||||
borderLines++;
|
borderLines++;
|
||||||
|
|
||||||
const auto orientation = gradient.orientation() == QskGradient::Horizontal
|
const auto orientation = qskQtOrientation( gradient );
|
||||||
? Qt::Horizontal : Qt::Vertical;
|
|
||||||
|
|
||||||
qskRenderBorder( metrics, orientation, borderColors, borderLines );
|
qskRenderBorder( metrics, orientation, borderColors, borderLines );
|
||||||
|
|
||||||
if ( extraLine )
|
if ( extraLine )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user