render bug fixed

This commit is contained in:
Uwe Rathmann 2022-11-24 11:31:49 +01:00
parent 86cb02466c
commit 8132c8a416

View File

@ -98,8 +98,6 @@ QSGNode* DiagramSkinlet::updateChartNode( const Diagram* diagram, QSGNode* node
const QRectF rect = diagram->subControlRect( Q::Chart ); const QRectF rect = diagram->subControlRect( Q::Chart );
const qreal yMax = diagram->yMax(); const qreal yMax = diagram->yMax();
const QVector< Diagram::Type > types = { Diagram::Line, Diagram::Area, Diagram::Bar };
for( int i = 0; i < diagram->dataPoints().size(); ++i ) for( int i = 0; i < diagram->dataPoints().size(); ++i )
{ {
QSGNode* chartNode; QSGNode* chartNode;
@ -122,10 +120,8 @@ QSGNode* DiagramSkinlet::updateChartNode( const Diagram* diagram, QSGNode* node
int lineWidth = diagram->metric( lineSubcontrol | QskAspect::Size ); int lineWidth = diagram->metric( lineSubcontrol | QskAspect::Size );
for( int j = 0; j < types.size(); ++j ) for( const auto type : { Diagram::Line, Diagram::Area, Diagram::Bar } )
{ {
const auto type = types.at( j );
if( diagram->typesAt( i ) & type ) if( diagram->typesAt( i ) & type )
{ {
QColor color; QColor color;
@ -208,9 +204,8 @@ QSGNode* DiagramSkinlet::updateChartNode( const Diagram* diagram, QSGNode* node
dataPointNode->update( rect, nodeType, color, dataPoints, yMax, false, lineWidth ); dataPointNode->update( rect, nodeType, color, dataPoints, yMax, false, lineWidth );
} }
nodeIndex++;
} }
nodeIndex++;
} }
while( nodeIndex < chartNode->childCount() ) while( nodeIndex < chartNode->childCount() )