diff --git a/extensions/GUI/CCScrollView/CCScrollView.cpp b/extensions/GUI/CCScrollView/CCScrollView.cpp index 74717f842d..01abe5ca06 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.cpp +++ b/extensions/GUI/CCScrollView/CCScrollView.cpp @@ -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) { } diff --git a/extensions/GUI/CCScrollView/CCScrollView.h b/extensions/GUI/CCScrollView/CCScrollView.h index e4d62a7947..a7939ee433 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.h +++ b/extensions/GUI/CCScrollView/CCScrollView.h @@ -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 */