From 001a7340cd921b3b99d96ad9b60b80cf975dc8dd Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 24 Nov 2023 08:24:28 +0100 Subject: [PATCH] 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. --- .../ProjectDataModel/Summary/RimSummaryCurveCollection.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.cpp index 70fbf082cd..cecd9a0381 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCurveCollection.cpp @@ -113,7 +113,9 @@ void RimSummaryCurveCollection::onChildrenUpdated( caf::PdmChildArrayFieldHandle { for ( auto obj : updatedObjects ) { - if ( auto curve = dynamic_cast( 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() ) { curve->updateCurveAppearance(); }