Make sure curve is updated when a child object of a curve is modified

Appearance settings is a child object of a curve, and requires update of the curve object.
This commit is contained in:
Magne Sjaastad 2023-11-24 08:24:28 +01:00
parent cd320c3b87
commit 001a7340cd

View File

@ -113,7 +113,9 @@ void RimSummaryCurveCollection::onChildrenUpdated( caf::PdmChildArrayFieldHandle
{ {
for ( auto obj : updatedObjects ) for ( auto obj : updatedObjects )
{ {
if ( auto curve = dynamic_cast<RimSummaryCurve*>( obj ) ) // Must use firstAncestorOrThisOfType, since we need to update the curve appearance if the object is a child of a
// RimSummaryCurve. This is the case when modifying curve appearance.
if ( auto curve = obj->firstAncestorOrThisOfType<RimSummaryCurve>() )
{ {
curve->updateCurveAppearance(); curve->updateCurveAppearance();
} }