From 551a8e7354209a2f81113002dfcca7daf3d408e5 Mon Sep 17 00:00:00 2001 From: Knox Date: Mon, 6 Aug 2018 12:03:53 +0800 Subject: [PATCH 1/3] fix isloop value error in audioengine (#3042) --- cocos2d/audio/CCAudioEngine.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos2d/audio/CCAudioEngine.js b/cocos2d/audio/CCAudioEngine.js index 3651f88c2c..ded7eae87d 100644 --- a/cocos2d/audio/CCAudioEngine.js +++ b/cocos2d/audio/CCAudioEngine.js @@ -161,9 +161,9 @@ var audioEngine = { */ isLoop: function (audioID) { var audio = getAudioFromId(audioID); - if (!audio || !audio.isLoop) + if (!audio || !audio.getLoop) return false; - return audio.isLoop(); + return audio.getLoop(); }, /** From b520f3c676c5a66dd34c7acc1d44341aaf5fa7e6 Mon Sep 17 00:00:00 2001 From: Knox Date: Mon, 6 Aug 2018 14:20:13 +0800 Subject: [PATCH 2/3] improve editorbox display text in qqplay (#3044) --- cocos2d/core/editbox/CCSGEditBox.js | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos2d/core/editbox/CCSGEditBox.js b/cocos2d/core/editbox/CCSGEditBox.js index d44bacd176..467057ef3f 100644 --- a/cocos2d/core/editbox/CCSGEditBox.js +++ b/cocos2d/core/editbox/CCSGEditBox.js @@ -917,6 +917,7 @@ _ccsg.EditBox.KeyboardReturnType = KeyboardReturnType; proto._showBKKeyboard = function () { BK.Editor.showKeyBoard(this._onBKBtnClick.bind(this), this._onBKTextChange.bind(this)); var editBox = this._editBox; + BK.Editor.setText(editBox._text); editBox._delegate && editBox._delegate.editBoxEditingDidBegan && editBox._delegate.editBoxEditingDidBegan(editBox); }; } From 111da455d089e3000f670eed24ff5172a3488245 Mon Sep 17 00:00:00 2001 From: Knox Date: Mon, 6 Aug 2018 14:52:12 +0800 Subject: [PATCH 3/3] Fix return type should be vec2 instead of simple object for fireball/issues/7898 (#3046) --- cocos2d/core/CCDirector.js | 4 ++-- cocos2d/core/event-manager/CCEvent.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cocos2d/core/CCDirector.js b/cocos2d/core/CCDirector.js index d3d4984f68..51946f3bba 100644 --- a/cocos2d/core/CCDirector.js +++ b/cocos2d/core/CCDirector.js @@ -263,7 +263,7 @@ cc.Director = Class.extend(/** @lends cc.Director# */{ var top = box.top + window.pageYOffset - container.clientTop; var x = view._devicePixelRatio * (uiPoint.x - left); var y = view._devicePixelRatio * (top + box.height - uiPoint.y); - return view._isRotated ? {x: view._viewPortRect.width - y, y: x} : {x: x, y: y}; + return view._isRotated ? cc.v2(view._viewportRect.width - y, x) : cc.v2(x, y); }, /** @@ -282,7 +282,7 @@ cc.Director = Class.extend(/** @lends cc.Director# */{ var box = container.getBoundingClientRect(); var left = box.left + window.pageXOffset - container.clientLeft; var top = box.top + window.pageYOffset - container.clientTop; - var uiPoint = {x: 0, y: 0}; + var uiPoint = cc.v2(0, 0); if (view._isRotated) { uiPoint.x = left + glPoint.y / view._devicePixelRatio; uiPoint.y = top + box.height - (view._viewPortRect.width - glPoint.x) / view._devicePixelRatio; diff --git a/cocos2d/core/event-manager/CCEvent.js b/cocos2d/core/event-manager/CCEvent.js index fa781d6355..7d419f1feb 100644 --- a/cocos2d/core/event-manager/CCEvent.js +++ b/cocos2d/core/event-manager/CCEvent.js @@ -103,7 +103,7 @@ proto.setLocation = function (x, y) { * @return {Vec2} location */ proto.getLocation = function () { - return {x: this._x, y: this._y}; + return cc.v2(this._x, this._y); }; /** @@ -113,7 +113,7 @@ proto.getLocation = function () { * @return {Vec2} */ proto.getLocationInView = function() { - return {x: this._x, y: cc.view._designResolutionSize.height - this._y}; + return cc.v2(this._x, cc.view._designResolutionSize.height - this._y); }; proto._setPrevCursor = function (x, y) { @@ -128,7 +128,7 @@ proto._setPrevCursor = function (x, y) { * @return {Vec2} */ proto.getPreviousLocation = function () { - return {x: this._prevX, y: this._prevY}; + return cc.v2(this._prevX, this._prevY); }; /** @@ -138,7 +138,7 @@ proto.getPreviousLocation = function () { * @return {Vec2} */ proto.getDelta = function () { - return {x: this._x - this._prevX, y: this._y - this._prevY}; + return cc.v2(this._x - this._prevX, this._y - this._prevY); }; /**