From 6b1ef043a96334f2ff2c5760d77053527760fae8 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Tue, 22 Oct 2024 08:53:11 +0200 Subject: [PATCH] vertical/horizontal lines are valid paths with an empty bounding rectangle --- playground/shapes/ShapeItem.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 )