Merge pull request #7653 from takaken1994/feature/improve-extensions-scrollview

Update : added function for setting min/max scale
This commit is contained in:
minggo 2014-08-05 11:52:22 +08:00
commit 38e4ad0fbd
2 changed files with 21 additions and 17 deletions

View File

@ -51,10 +51,7 @@ static float convertDistanceFromPointToInch(float pointDis)
ScrollView::ScrollView()
: _zoomScale(0.0f)
, _minZoomScale(0.0f)
, _maxZoomScale(0.0f)
, _delegate(nullptr)
: _delegate(nullptr)
, _direction(Direction::BOTH)
, _dragging(false)
, _container(nullptr)
@ -65,6 +62,7 @@ ScrollView::ScrollView()
, _minScale(0.0f)
, _maxScale(0.0f)
, _touchListener(nullptr)
, _scissorRestored(false)
{
}

View File

@ -146,6 +146,24 @@ public:
* @param dt The animation duration
*/
void setZoomScaleInDuration(float s, float dt);
/**
* Set min scale
*
* @param minScale min scale
*/
void setMinScale(float minScale) {
_minScale = minScale;
}
/**
* Set max scale
*
* @param maxScale max scale
*/
void setMaxScale(float maxScale) {
_maxScale = maxScale;
}
/**
* Returns the current container's minimum offset. You may want this while you animate scrolling by yourself
*/
@ -275,19 +293,7 @@ protected:
void handleZoom();
Rect getViewRect();
/**
* current zoom scale
*/
float _zoomScale;
/**
* min zoom scale
*/
float _minZoomScale;
/**
* max zoom scale
*/
float _maxZoomScale;
/**
* scroll view delegate
*/