From ada3be71e0be91b3ec2e491ed58669e70e662dd7 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Sat, 14 Sep 2024 17:43:37 +0200 Subject: [PATCH] QskBoxFillNode fixed - updating the material first. --- playground/gradients/GradientView.cpp | 2 ++ src/nodes/QskBoxFillNode.cpp | 18 +++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/playground/gradients/GradientView.cpp b/playground/gradients/GradientView.cpp index b067955e..57ba687d 100644 --- a/playground/gradients/GradientView.cpp +++ b/playground/gradients/GradientView.cpp @@ -168,7 +168,9 @@ QSGNode* GradientView::updatePaintNode( case BoxRectangle: { QskBoxShapeMetrics shape; +#if 0 shape.setRadius( 80 ); +#endif if ( !QskBoxRenderer::isGradientSupported( shape, m_gradient ) ) { diff --git a/src/nodes/QskBoxFillNode.cpp b/src/nodes/QskBoxFillNode.cpp index 2da882c5..7332dbf7 100644 --- a/src/nodes/QskBoxFillNode.cpp +++ b/src/nodes/QskBoxFillNode.cpp @@ -71,15 +71,6 @@ void QskBoxFillNode::updateNode( d->gradientHash = gradientHash; d->rect = rect; - if ( dirtyMetrics ) - { - QskBoxRenderer::renderFillGeometry( - rect, shapeMetrics, borderMetrics, *geometry() ); - - markDirty( QSGNode::DirtyGeometry ); - geometry()->markVertexDataDirty(); - } - if ( gradient.isMonochrome() ) { if ( dirtyColors ) @@ -92,4 +83,13 @@ void QskBoxFillNode::updateNode( if ( dirtyColors || dirtyMetrics ) setColoring( rect, gradient.effectiveGradient() ); } + + if ( dirtyMetrics ) + { + QskBoxRenderer::renderFillGeometry( + rect, shapeMetrics, borderMetrics, *geometry() ); + + markDirty( QSGNode::DirtyGeometry ); + geometry()->markVertexDataDirty(); + } }