X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fscrollable%2Fscroll-view%2Fscroll-view-page-path-effect-impl.cpp;h=deced96872b7b156b98f00979d5c98a4388bbc9d;hb=b8da2e53925b9abb9fa362560069e8ca4aa62f81;hp=f12b873de2611d1b0c9ab946d6afa80b7acafdbf;hpb=36a298758d1b6244b7846a0102b528d76002dbda;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-path-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-path-effect-impl.cpp index f12b873..deced96 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-path-effect-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-path-effect-impl.cpp @@ -26,68 +26,68 @@ namespace Dali { - namespace Toolkit { - namespace Internal { - -ScrollViewPagePathEffect::ScrollViewPagePathEffect(Path path, const Vector3& forward, Dali::Property::Index inputPropertyIndex, const Vector3& pageSize, unsigned int pageCount) -:mPageSize(pageSize), - mInputPropertyIndex(inputPropertyIndex), - mPageCount(pageCount) +ScrollViewPagePathEffect::ScrollViewPagePathEffect(Path path, const Vector3& forward, Dali::Property::Index inputPropertyIndex, const Vector3& viewPageSize, unsigned int pageCount) +: mPageSize(viewPageSize), + mInputPropertyIndex(inputPropertyIndex), + mPageCount(pageCount) { //Create path constrainer mPathConstrainer = Dali::PathConstrainer::New(); - mPathConstrainer.SetProperty( PathConstrainer::Property::FORWARD, forward ); + mPathConstrainer.SetProperty(PathConstrainer::Property::FORWARD, forward); Dali::Property::Value pointsProperty = path.GetProperty(Path::Property::POINTS); - mPathConstrainer.SetProperty( PathConstrainer::Property::POINTS, pointsProperty ); + mPathConstrainer.SetProperty(PathConstrainer::Property::POINTS, pointsProperty); pointsProperty = path.GetProperty(Path::Property::CONTROL_POINTS); - mPathConstrainer.SetProperty( PathConstrainer::Property::CONTROL_POINTS, pointsProperty ); + mPathConstrainer.SetProperty(PathConstrainer::Property::CONTROL_POINTS, pointsProperty); //Create linear constrainer - pointsProperty = Property::Value(Property::ARRAY); + pointsProperty = Property::Value(Property::ARRAY); Property::Array* array = pointsProperty.GetArray(); - array->PushBack(0.0f); - array->PushBack(1.0f); - array->PushBack(0.0f); + + if(array) + { + array->PushBack(0.0f); + array->PushBack(1.0f); + array->PushBack(0.0f); + } mLinearConstrainer = Dali::LinearConstrainer::New(); - mLinearConstrainer.SetProperty( LinearConstrainer::Property::VALUE, pointsProperty ); + mLinearConstrainer.SetProperty(LinearConstrainer::Property::VALUE, pointsProperty); } ScrollViewPagePathEffect::~ScrollViewPagePathEffect() { } -void ScrollViewPagePathEffect::ApplyToPage( Actor page, unsigned int pageOrder ) +void ScrollViewPagePathEffect::ApplyToPage(Actor page, unsigned int pageOrder) { - float pageHalfSize = mPageSize.x * 0.5f; - Vector2 range = Vector2( pageHalfSize - (pageHalfSize*pageOrder), -pageHalfSize - (pageHalfSize*pageOrder) ); - Vector2 wrap = Vector2( range.x, -pageHalfSize*(mPageCount-2) + range.y); + float pageHalfSize = mPageSize.x * 0.5f; + Vector2 range = Vector2(pageHalfSize - (pageHalfSize * pageOrder), -pageHalfSize - (pageHalfSize * pageOrder)); + Vector2 wrap = Vector2(range.x, -pageHalfSize * (mPageCount - 2) + range.y); Toolkit::ScrollView scrollView = GetScrollView(); //Position - mPathConstrainer.Apply( Dali::Property( page, Dali::Actor::Property::POSITION ), - Dali::Property( scrollView, mInputPropertyIndex), - range, wrap - ); + mPathConstrainer.Apply(Dali::Property(page, Dali::Actor::Property::POSITION), + Dali::Property(scrollView, mInputPropertyIndex), + range, + wrap); //Rotation - mPathConstrainer.Apply( Dali::Property( page, Dali::Actor::Property::ORIENTATION ), - Dali::Property( scrollView, mInputPropertyIndex ), - range, wrap - ); + mPathConstrainer.Apply(Dali::Property(page, Dali::Actor::Property::ORIENTATION), + Dali::Property(scrollView, mInputPropertyIndex), + range, + wrap); //Alpha - mLinearConstrainer.Apply( Dali::Property( page, Dali::Actor::Property::COLOR_ALPHA ), - Dali::Property( scrollView, mInputPropertyIndex ), - range, wrap - ); - + mLinearConstrainer.Apply(Dali::Property(page, Dali::Actor::Property::COLOR_ALPHA), + Dali::Property(scrollView, mInputPropertyIndex), + range, + wrap); } void ScrollViewPagePathEffect::OnAttach(Toolkit::ScrollView& scrollView)