fix fireball/issues/7368 (#2743)

This commit is contained in:
Knox
2018-05-25 18:19:10 +08:00
committed by Jare Guo
parent 81f35845fc
commit 2b35813c26
+2 -6
View File
@@ -1245,8 +1245,8 @@ var ScrollView = cc.Class({
this._autoScrolling = false;
}
var contentPos = cc.pSub(newPosition, this.getContentPosition());
this._moveContent(contentPos, reachedEnd);
var deltaMove = cc.pSub(newPosition, this.getContentPosition());
this._moveContent(this._clampDelta(deltaMove), reachedEnd);
this._dispatchEvent('scrolling');
if (!this._autoScrolling) {
@@ -1334,7 +1334,6 @@ var ScrollView = cc.Class({
this._autoScrollBraking = true;
}
}
},
_calculateTouchMoveVelocity: function() {
@@ -1365,7 +1364,6 @@ var ScrollView = cc.Class({
_moveContent: function(deltaMove, canStartBounceBack) {
var adjustedMove = this._flattenVectorByDirection(deltaMove);
var newPosition = cc.pAdd(this.getContentPosition(), adjustedMove);
this.setContentPosition(newPosition);
@@ -1376,10 +1374,8 @@ var ScrollView = cc.Class({
if (this.elastic && canStartBounceBack) {
this._startBounceBackIfNeeded();
}
},
_getContentLeftBoundary: function() {
var contentPos = this.getContentPosition();
var leftBoundary = contentPos.x - this.content.getAnchorPoint().x * this.content.getContentSize().width;