diff --git a/cocos2d/core/platform/CCEGLView.js b/cocos2d/core/platform/CCEGLView.js index 8b55e7cf9f..9f73ed913c 100644 --- a/cocos2d/core/platform/CCEGLView.js +++ b/cocos2d/core/platform/CCEGLView.js @@ -204,9 +204,9 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{ // Resize helper functions _resizeEvent: function () { var view; - if(this.setDesignResolutionSize){ + if (this.setDesignResolutionSize) { view = this; - }else{ + } else { view = cc.view; } @@ -222,8 +222,9 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{ } var width = view._originalDesignResolutionSize.width; var height = view._originalDesignResolutionSize.height; - if (width > 0) + if (width > 0) { view.setDesignResolutionSize(width, height, view._resolutionPolicy); + } }, /** @@ -339,6 +340,8 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{ _adjustViewportMeta: function () { if (this._isAdjustViewPort) { this._setViewportMeta(cc.__BrowserGetter.meta, false); + // Only adjust viewport once + this._isAdjustViewPort = false; } }, diff --git a/cocos2d/kazmath/vec3.js b/cocos2d/kazmath/vec3.js index a860d82e83..d9eafbee2f 100644 --- a/cocos2d/kazmath/vec3.js +++ b/cocos2d/kazmath/vec3.js @@ -51,7 +51,7 @@ return new cc.math.Vec3(x, y, z); }; - var _p = cc.math.Vec3._ptype; + var _p = cc.math.Vec3.prototype; _p.fill = function (x, y, z) { // =cc.kmVec3Fill if (x && y === undefined) {