From 7aa695599bb8d4f78ce905c54641a7bb8c5f3f22 Mon Sep 17 00:00:00 2001 From: isn Date: Fri, 11 Jan 2019 16:27:16 +0300 Subject: [PATCH] refs #1847 colors assignment after merging of polylines Signed-off-by: isn --- src/HYDROData/HYDROData_PolylineOperator.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/HYDROData/HYDROData_PolylineOperator.cxx b/src/HYDROData/HYDROData_PolylineOperator.cxx index 1b0c8985..fff5820a 100644 --- a/src/HYDROData/HYDROData_PolylineOperator.cxx +++ b/src/HYDROData/HYDROData_PolylineOperator.cxx @@ -173,7 +173,7 @@ bool HYDROData_PolylineOperator::Merge( const Handle( HYDROData_Document )& theD NCollection_Sequence aSectNames; NCollection_Sequence aSectTypes; NCollection_Sequence aSectClosures; - aPolyline->GetSections( aSectNames, aSectTypes, aSectClosures ); + aPolyline->GetSections( aSectNames, aSectTypes, aSectClosures ); for ( int i = 1, n = aSectNames.Size(); i <= n; ++i ) { @@ -182,7 +182,12 @@ bool HYDROData_PolylineOperator::Merge( const Handle( HYDROData_Document )& theD bool aSectClosure = aSectClosures.Value( i ); aNewPolyline->AddSection(aSectName, aSectType, aSectClosure); HYDROData_PolylineXY::PointsList aPointsList = aPolyline->GetPoints(i-1, false); - aNewPolyline->SetPoints(ins++, aPointsList); + QColor sectColor; + aPolyline->getSectionColor(i-1, sectColor); + aNewPolyline->SetPoints(ins, aPointsList); + if (sectColor.isValid()) + aNewPolyline->setSectionColor(ins, sectColor); + ins++; } } QString aName = theName; -- 2.39.2