Commit ded6f853c2260a9d46a2724b82d38eb762d04f0c

Authored by Kimmo Hoikka
Committed by Paul Wisbey
1 parent f3f0570a

fix cluster example to work after shader inheritance removal

requires https://review.tizen.org/gerrit/#/c/25415/

Change-Id: I768e7bd57e2250fd16580b85886250591599f159
examples/cluster/cluster-example.cpp
... ... @@ -713,7 +713,6 @@ public:
713 713 mScrollView.SetActorAutoSnap(false);
714 714  
715 715 // Remove all shader-effects from mScrollView and it's children (the clusters)
716   - mScrollView.RemoveShaderEffect();
717 716 mScrollView.SetPosition(Vector3::ZERO);
718 717  
719 718 mLayoutButton.SetBackgroundImage( mLayoutButtonImages[ type ] );
... ... @@ -721,7 +720,7 @@ public:
721 720 for( vector<ClusterInfo>::iterator i = mClusterInfo.begin(); i != mClusterInfo.end(); ++i )
722 721 {
723 722 Cluster cluster = i->mCluster;
724   - cluster.RemoveShaderEffect();
  723 + RemoveShaderEffectRecursively( cluster );
725 724 if( i->mEffectConstraint )
726 725 {
727 726 cluster.RemoveConstraint(i->mEffectConstraint);
... ... @@ -759,7 +758,7 @@ public:
759 758 ShearEffectCenterConstraint(stageSize, shearCenter) );
760 759 shaderEffect.ApplyConstraint(constraint);
761 760  
762   - cluster.SetShaderEffect(shaderEffect);
  761 + SetShaderEffectRecursively( cluster,shaderEffect );
763 762  
764 763 // Apply Constraint to Shader Effect
765 764 Property::Index scrollOvershootProperty = /*targetGroup*/mScrollView.GetPropertyIndex(ScrollViewWobbleEffect::EFFECT_OVERSHOOT);
... ... @@ -787,7 +786,12 @@ public:
787 786 // Apply Carousel Shader Effect to scrollView
788 787 CarouselEffect shaderEffect = CarouselEffect::New();
789 788 shaderEffect.SetRadius( -CAROUSEL_EFFECT_RADIUS );
790   - mScrollView.SetShaderEffect( shaderEffect );
  789 + // dont apply shader effect to scrollview as it might override internal shaders for bounce effect etc
  790 + for( vector<ClusterInfo>::iterator i = mClusterInfo.begin(); i != mClusterInfo.end(); ++i )
  791 + {
  792 + Cluster cluster = i->mCluster;
  793 + SetShaderEffectRecursively( cluster, shaderEffect );
  794 + }
791 795 mScrollView.SetPosition( Vector3( 0.0f, 0.0f, CAROUSEL_EFFECT_RADIUS ) );
792 796  
793 797 const Vector2 angleSweep( CAROUSEL_EFFECT_ANGLE_SWEEP / stageSize.width,
... ... @@ -819,12 +823,13 @@ public:
819 823  
820 824 shaderEffect.SetRadius( SPHERE_EFFECT_RADIUS );
821 825 shaderEffect.SetAnglePerUnit( Vector2( SPHERE_EFFECT_ANGLE_SWEEP / stageSize.y, SPHERE_EFFECT_ANGLE_SWEEP / stageSize.y ) );
822   - mScrollView.SetShaderEffect( shaderEffect );
  826 + // dont apply shader effect to scrollview as it might override internal shaders for bounce effect etc
823 827 for( vector<ClusterInfo>::iterator i = mClusterInfo.begin(); i != mClusterInfo.end(); ++i )
824 828 {
825 829 Constraint constraint = Constraint::New<float>(Actor::POSITION_Z, SphereEffectOffsetConstraint(SPHERE_EFFECT_POSITION_Z));
826 830 constraint.SetRemoveAction(Constraint::Discard);
827 831 Cluster cluster = i->mCluster;
  832 + SetShaderEffectRecursively( cluster, shaderEffect );
828 833 i->mEffectConstraint = cluster.ApplyConstraint(constraint);
829 834 }
830 835 break;
... ...