update issues fixed

This commit is contained in:
Uwe Rathmann 2023-12-21 07:14:55 +01:00
parent f3ee4749b8
commit 583cf4e87f
4 changed files with 15 additions and 6 deletions

View File

@ -154,21 +154,24 @@ namespace
texture->setTextureNode( textureNode ); texture->setTextureNode( textureNode );
} }
textureNode->setRect( rect );
auto texture = qobject_cast< QskSceneTexture* >( textureNode->texture() ); auto texture = qobject_cast< QskSceneTexture* >( textureNode->texture() );
Q_ASSERT( texture ); Q_ASSERT( texture );
if ( texture->isDirty() ) if ( texture->isDirty() || rect != textureNode->rect() )
{ {
texture->setFiltering( texture->setFiltering(
overlay->smooth() ? QSGTexture::Linear : QSGTexture::Nearest ); overlay->smooth() ? QSGTexture::Linear : QSGTexture::Nearest );
auto finalNode = const_cast< QSGTransformNode* >( qskItemNode( overlay ) ); auto finalNode = const_cast< QSGTransformNode* >( qskItemNode( overlay ) );
texture->render( rootNode, finalNode, overlay->geometry() );
texture->render( rootNode, finalNode,
rect.translated( overlay->position() ) );
textureNode->markDirty( QSGNode::DirtyMaterial ); textureNode->markDirty( QSGNode::DirtyMaterial );
} }
textureNode->setRect( rect );
return textureNode; return textureNode;
} }
}; };

View File

@ -88,6 +88,11 @@ void TextureFilterNode::setRect( const QRectF& rect )
} }
} }
QRectF TextureFilterNode::rect() const
{
return d_func()->rect;
}
void TextureFilterNode::setOwnsTexture( bool on ) void TextureFilterNode::setOwnsTexture( bool on )
{ {
d_func()->ownsTexture = on; d_func()->ownsTexture = on;

View File

@ -27,6 +27,7 @@ class TextureFilterNode : public QSGGeometryNode
bool ownsTexture() const; bool ownsTexture() const;
void setRect( const QRectF& ); void setRect( const QRectF& );
QRectF rect() const;
void setTextureMaterial( TextureFilterMaterial* ); void setTextureMaterial( TextureFilterMaterial* );
TextureFilterMaterial* textureMaterial() const; TextureFilterMaterial* textureMaterial() const;

View File

@ -151,6 +151,8 @@ namespace
void Renderer::render() void Renderer::render()
{ {
m_dirty = false;
qskTryBlockTrailingNodes( m_finalNode, rootNode(), true, false ); qskTryBlockTrailingNodes( m_finalNode, rootNode(), true, false );
#if 0 #if 0
@ -160,8 +162,6 @@ namespace
#endif #endif
Inherited::render(); Inherited::render();
qskTryBlockTrailingNodes( m_finalNode, rootNode(), false, false ); qskTryBlockTrailingNodes( m_finalNode, rootNode(), false, false );
m_dirty = false;
} }
void Renderer::nodeChanged( QSGNode* node, QSGNode::DirtyState state ) void Renderer::nodeChanged( QSGNode* node, QSGNode::DirtyState state )