From 81f35845fc2c7f6c04936b764671956578e9afad Mon Sep 17 00:00:00 2001 From: Knox Date: Wed, 23 May 2018 10:00:59 +0800 Subject: [PATCH 1/3] Improve checking whether is a subdomain method (#2719) --- cocos2d/core/platform/CCSys.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos2d/core/platform/CCSys.js b/cocos2d/core/platform/CCSys.js index f26fab9100..36eb387316 100644 --- a/cocos2d/core/platform/CCSys.js +++ b/cocos2d/core/platform/CCSys.js @@ -576,7 +576,7 @@ else if (CC_WECHATGAME) { sys.osVersion = version[0]; sys.osMainVersion = parseInt(sys.osVersion); // wechagame subdomain - if (wx.getGroupCloudStorage && wx.getFriendCloudStorage) { + if (!wx.getFileSystemManager) { sys.browserType = sys.BROWSER_TYPE_WECHAT_GAME_SUB; } else { From 2b35813c26a94e20e7295ed3c31f4e7534cd3fab Mon Sep 17 00:00:00 2001 From: Knox Date: Fri, 25 May 2018 18:19:10 +0800 Subject: [PATCH 2/3] fix fireball/issues/7368 (#2743) --- cocos2d/core/components/CCScrollView.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cocos2d/core/components/CCScrollView.js b/cocos2d/core/components/CCScrollView.js index 83268bc67d..c8af85c20b 100644 --- a/cocos2d/core/components/CCScrollView.js +++ b/cocos2d/core/components/CCScrollView.js @@ -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; From 9029fe04470d229b0950b2e60df377a0d1aa6d8b Mon Sep 17 00:00:00 2001 From: Knox Date: Sun, 27 May 2018 23:00:25 +0800 Subject: [PATCH 3/3] fix fireball/issues/7369 (#2741) --- cocos2d/audio/CCAudio.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos2d/audio/CCAudio.js b/cocos2d/audio/CCAudio.js index c6415d251c..3208376d92 100644 --- a/cocos2d/audio/CCAudio.js +++ b/cocos2d/audio/CCAudio.js @@ -201,7 +201,7 @@ Audio.State = { }; proto.resume = function () { - if (!this._element || this._element.currentTime === 0) return; + if (!this._element || this._state === Audio.State.PLAYING) return; this._bindEnded(); this._element.play(); this.emit('resume');