(Constraints) Ensure first value is baked appropriately if no weight-input is given 12/28712/1
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 14 Oct 2014 09:19:39 +0000 (10:19 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 14 Oct 2014 12:13:27 +0000 (13:13 +0100)
[problem]      We NEVER bake the first value of a constraint.
[cause]        The weight input value is always dirty on initialisation and in this scenario we always set.
[solution]     Do not consider the dirty flag of the weight-input value when we first apply the
               constraint.

Change-Id: Ic88fd4cb3d30483b0b131fda4fcfa6ccd9d96c70

dali/internal/update/animation/scene-graph-constraint.h

index 56ee3a6..de9b4b5 100644 (file)
@@ -117,13 +117,15 @@ public:
       return; // Early-out when property owners have been disconnected
     }
 
+    bool firstApply( mFirstApply );
+
     if ( mFunc->InputsInitialized() &&
          ApplyNeeded() )
     {
       const PropertyType& current = mTargetProperty.Get( updateBufferIndex );
 
       // FINAL_WEIGHT means the constraint is fully-applied, unless weight is still being animated
-      if ( ! mWeightInput->IsClean() ||
+      if ( ( ! firstApply && ! mWeightInput->IsClean() ) || // We should not rely on the flag state of weight-input on first apply
            ! Equals( Dali::ActiveConstraint::FINAL_WEIGHT, (*mWeightInput)[updateBufferIndex] ) )
       {
         // Constraint is not fully-applied; interpolation between start & final values