From e1f9ff7eaa0e022630e6bc63494b83c3f4db7b41 Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 27 May 2014 10:44:31 +0800 Subject: [PATCH] add constness to UIPageView --- cocos/ui/UIPageView.cpp | 4 ++-- cocos/ui/UIPageView.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cocos/ui/UIPageView.cpp b/cocos/ui/UIPageView.cpp index e3e4517092..f882663a59 100644 --- a/cocos/ui/UIPageView.cpp +++ b/cocos/ui/UIPageView.cpp @@ -200,12 +200,12 @@ void PageView::updateBoundaryPages() _rightBoundaryChild = _pages.at(this->getPageCount()-1); } -ssize_t PageView::getPageCount() +ssize_t PageView::getPageCount()const { return _pages.size(); } -float PageView::getPositionXByIndex(ssize_t idx) +float PageView::getPositionXByIndex(ssize_t idx)const { return (getSize().width * (idx-_curPageIdx)); } diff --git a/cocos/ui/UIPageView.h b/cocos/ui/UIPageView.h index af3ba46f25..bc5d11cb03 100644 --- a/cocos/ui/UIPageView.h +++ b/cocos/ui/UIPageView.h @@ -178,8 +178,8 @@ CC_CONSTRUCTOR_ACCESS: protected: Layout* createPage(); - float getPositionXByIndex(ssize_t idx); - ssize_t getPageCount(); + float getPositionXByIndex(ssize_t idx)const; + ssize_t getPageCount()const; void updateBoundaryPages(); virtual bool scrollPages(float touchOffset);