// EXTERNAL INCLUDES
#include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/devel-api/rendering/cull-face.h>
namespace Dali
{
mTurningPageLayer.SetParentOrigin( ParentOrigin::CENTER );
}
-ImageActor PageTurnLandscapeView::NewPageFromRenderBuffer( int pageIndex )
-{
- int index = pageIndex % NUMBER_OF_CACHED_PAGES;
- ImageActor page = ImageActor::New( mRenderedPage[ index ],
- ImageActor::PixelArea( mPageSize.width, 0, mPageSize.width, mPageSize.height ) );
- if( pageIndex <= mTotalPageCount-1)
- {
- int nextIndex = (pageIndex+1) % NUMBER_OF_CACHED_PAGES;
- page.Add( ImageActor::New( mRenderedPage[ nextIndex ],ImageActor::PixelArea( 0, 0, mPageSize.width, mPageSize.height ) ) );
- }
- return page;
-}
-
void PageTurnLandscapeView::OnAddPage( ImageActor newPage, bool isLeftSide )
{
newPage.SetParentOrigin( ParentOrigin::CENTER );
- newPage.SetCullFace( CullBack );
+ SetCullFace( newPage, CullBack );
if( 0 < newPage.GetChildCount() )
{
ImageActor backImage = ImageActor::DownCast( newPage.GetChildAt( 0 ) );
- backImage.SetPositionInheritanceMode( USE_PARENT_POSITION_PLUS_LOCAL_POSITION );
+ backImage.SetParentOrigin( ParentOrigin::CENTER );
backImage.SetSize( mPageSize );
- backImage.SetCullFace( CullFront );
+ SetCullFace( backImage, CullFront );
backImage.SetZ( 0.25f * STATIC_PAGE_INTERVAL_DISTANCE );
}
if( isLeftSide )
if( panPosition.x > mPageSize.width && mCurrentPageIndex < mTotalPageCount-1 )
{
mPanActor = mPageActors[mCurrentPageIndex%NUMBER_OF_CACHED_PAGES]; // right side page
+ mTurningPageIndex = mCurrentPageIndex;
}
else if( panPosition.x <= mPageSize.width && mCurrentPageIndex > 0 )
{
mPanActor = mPageActors[ (mCurrentPageIndex-1)%NUMBER_OF_CACHED_PAGES ]; // left side page
+ mTurningPageIndex = mCurrentPageIndex - 1;
}
else
{