diff --git a/playground/shapes/ShapeItem.cpp b/playground/shapes/ShapeItem.cpp index 53a39fb5..da4f4e49 100644 --- a/playground/shapes/ShapeItem.cpp +++ b/playground/shapes/ShapeItem.cpp @@ -146,7 +146,6 @@ void ShapeItem::updateNode( QSGNode* parentNode ) }; const auto rect = contentsRect(); - const auto pathRect = m_data->path.controlPointRect(); auto fillNode = static_cast< QskShapeNode* >( QskSGNode::findChildNode( parentNode, FillRole ) ); @@ -154,7 +153,7 @@ void ShapeItem::updateNode( QSGNode* parentNode ) auto borderNode = static_cast< QskStrokeNode* >( QskSGNode::findChildNode( parentNode, BorderRole ) ); - if ( rect.isEmpty() || pathRect.isEmpty() ) + if ( rect.isEmpty() || m_data->path.isEmpty() ) { delete fillNode; delete borderNode; @@ -162,6 +161,8 @@ void ShapeItem::updateNode( QSGNode* parentNode ) return; } + const auto pathRect = m_data->path.controlPointRect(); + if ( m_data->gradient.isVisible() ) { if ( fillNode == nullptr )