QskBoxRenderer::isGradientSupported also depends on the shape ( at least

in the future )
This commit is contained in:
Uwe Rathmann 2022-12-06 16:37:18 +01:00
parent 8551f4459d
commit e1b65c6dd6
4 changed files with 5 additions and 4 deletions

View File

@ -83,7 +83,7 @@ void QskBoxNode::updateNode( const QRectF& rect,
However the border is always done with a QskBoxRectangleNode
*/
if ( QskBoxRenderer::isGradientSupported( gradient ) )
if ( QskBoxRenderer::isGradientSupported( shape, gradient ) )
{
rectNode = qskNode< QskBoxRectangleNode >( this, BoxRole );
rectNode->updateNode( rect, shape, borderMetrics, borderColors, gradient );

View File

@ -29,7 +29,7 @@ class QSK_EXPORT QskBoxRenderer
const QskBoxShapeMetrics&, const QskBoxBorderMetrics&,
const QskBoxBorderColors&, const QskGradient&, QSGGeometry& );
static bool isGradientSupported( const QskGradient& );
static bool isGradientSupported( const QskBoxShapeMetrics&, const QskGradient& );
class Metrics
{

View File

@ -663,7 +663,8 @@ void QskBoxRenderer::renderRectFill( const QskVertex::Quad& rect,
qskCreateFillOrdered( rect, gradient, line );
}
bool QskBoxRenderer::isGradientSupported( const QskGradient& gradient )
bool QskBoxRenderer::isGradientSupported(
const QskBoxShapeMetrics&, const QskGradient& gradient )
{
if ( !gradient.isVisible() || gradient.isMonochrome() )
return true;

View File

@ -128,7 +128,7 @@ void QskRectangleNode::updateNode(
d->rect = rect;
d->shape = effectiveShape;
if ( QskBoxRenderer::isGradientSupported( effectiveGradient ) )
if ( QskBoxRenderer::isGradientSupported( effectiveShape, effectiveGradient ) )
{
if ( material() != qskMaterialColorVertex )
{