mirror of https://github.com/axmolengine/axmol.git
Merge pull request #7653 from takaken1994/feature/improve-extensions-scrollview
Update : added function for setting min/max scale
This commit is contained in:
commit
38e4ad0fbd
|
@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue