This commit is contained in:
Uwe Rathmann 2020-07-25 09:56:30 +02:00
commit 22230365b7
4 changed files with 15 additions and 7 deletions

View File

@ -113,7 +113,7 @@ inline constexpr qreal QskIntervalF::upperBound() const noexcept
inline constexpr qreal QskIntervalF::width() const noexcept
{
return ( m_upperBound > m_lowerBound ) ? m_upperBound - m_upperBound : 0.0;
return ( m_upperBound > m_lowerBound ) ? ( m_upperBound - m_lowerBound ) : 0.0;
}
inline void QskIntervalF::setWidth( qreal width ) noexcept

View File

@ -162,12 +162,7 @@ QSGNode* QskPageIndicatorSkinlet::updateBulletsNode(
}
// if count has decreased we need to remove superfluous nodes
while ( bulletNode->nextSibling() != nullptr )
{
auto sibling = bulletNode->nextSibling();
node->removeChildNode( sibling );
delete sibling;
}
removeTraillingNodes( node, bulletNode );
return node;
}

View File

@ -377,6 +377,18 @@ void QskSkinlet::insertNodeSorted( QSGNode* node, QSGNode* parentNode ) const
parentNode->prependChildNode( node );
}
void QskSkinlet::removeTraillingNodes( QSGNode* node, QSGNode* child )
{
if ( node && child )
{
while ( auto sibling = child->nextSibling() )
{
node->removeChildNode( sibling );
delete sibling;
}
}
}
void QskSkinlet::setNodeRole( QSGNode* node, quint8 nodeRole )
{
qskSetRole( nodeRole, node );

View File

@ -49,6 +49,7 @@ class QSK_EXPORT QskSkinlet
static void setNodeRole( QSGNode* node, quint8 nodeRole );
static quint8 nodeRole( const QSGNode* node );
static void removeTraillingNodes( QSGNode* node, QSGNode* child );
static QSGNode* findNodeByRole( QSGNode* parent, quint8 nodeRole );