Skip to content

Fix resize event issue by avoiding adjust viewport meta multiple times #3258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions cocos2d/core/platform/CCEGLView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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);
}
},

/**
Expand Down Expand Up @@ -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;
}
},

Expand Down
2 changes: 1 addition & 1 deletion cocos2d/kazmath/vec3.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down