vertical/horizontal lines are valid paths with an empty bounding

rectangle
This commit is contained in:
Uwe Rathmann 2024-10-22 08:53:11 +02:00
parent 932d34aea8
commit 6b1ef043a9

View File

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