Fix view canvas-resize event emit (#2893)

This commit is contained in:
pandamicro
2018-06-22 18:51:14 +08:00
committed by GitHub
parent b0aec71174
commit 96e482bd74
+3 -3
View File
@@ -186,9 +186,9 @@ cc.js.mixin(View.prototype, {
// Resize helper functions
_resizeEvent: function () {
var view;
if(this.setDesignResolutionSize){
if (this.setDesignResolutionSize) {
view = this;
}else{
} else {
view = cc.view;
}
@@ -217,7 +217,7 @@ cc.js.mixin(View.prototype, {
view.setDesignResolutionSize(width, height, view._resolutionPolicy);
view._resizing = false;
this.emit('canvas-resize');
view.emit('canvas-resize');
if (view._resizeCallback) {
view._resizeCallback.call();
}