fix resize bug

This commit is contained in:
kekee000
2014-12-06 14:48:14 +08:00
parent 120f2499ba
commit 0368ff5cbe
2 changed files with 11 additions and 0 deletions

View File

@@ -80,6 +80,7 @@ define(
}
this.editor.focus();
this.editor.refresh();
this.editing = true;
};

View File

@@ -78,6 +78,12 @@ define(
if(this.options.enableResize) {
this.resizeCapture = new ResizeCapture(this.main);
this.resizeCapture.on('resize', function(e) {
// 对象被隐藏, 不做处理
if (me.main.style.display === 'none') {
me.hasResized = true;
return;
}
var prevSize = me.painter.getSize();
me.painter.resetSize();
var size = me.painter.getSize();
@@ -138,6 +144,10 @@ define(
* @return {this}
*/
Render.prototype.refresh = function() {
if (this.hasResized) {
this.painter.resetSize();
this.hasResized = false;
}
this.painter.refresh();
return this;
};