Skip to content

Commit 9363587

Browse files
committed
Merge pull request #3258 from pandamicro/develop
Fix resize event issue by avoiding adjust viewport meta multiple times
2 parents 7283fde + 892dd9a commit 9363587

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

cocos2d/core/platform/CCEGLView.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,9 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{
204204
// Resize helper functions
205205
_resizeEvent: function () {
206206
var view;
207-
if(this.setDesignResolutionSize){
207+
if (this.setDesignResolutionSize) {
208208
view = this;
209-
}else{
209+
} else {
210210
view = cc.view;
211211
}
212212

@@ -222,8 +222,9 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{
222222
}
223223
var width = view._originalDesignResolutionSize.width;
224224
var height = view._originalDesignResolutionSize.height;
225-
if (width > 0)
225+
if (width > 0) {
226226
view.setDesignResolutionSize(width, height, view._resolutionPolicy);
227+
}
227228
},
228229

229230
/**
@@ -339,6 +340,8 @@ cc.EGLView = cc.Class.extend(/** @lends cc.view# */{
339340
_adjustViewportMeta: function () {
340341
if (this._isAdjustViewPort) {
341342
this._setViewportMeta(cc.__BrowserGetter.meta, false);
343+
// Only adjust viewport once
344+
this._isAdjustViewPort = false;
342345
}
343346
},
344347

cocos2d/kazmath/vec3.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
return new cc.math.Vec3(x, y, z);
5252
};
5353

54-
var _p = cc.math.Vec3._ptype;
54+
var _p = cc.math.Vec3.prototype;
5555

5656
_p.fill = function (x, y, z) { // =cc.kmVec3Fill
5757
if (x && y === undefined) {

0 commit comments

Comments
 (0)