added padding attr change event binding to Text

This commit is contained in:
Eric Rowell 2012-07-01 17:08:59 -07:00
parent 39e8a7af8d
commit 66f29c602e
3 changed files with 5 additions and 9 deletions

View File

@ -3994,13 +3994,11 @@ Kinetic.Text = function(config) {
Kinetic.Shape.apply(this, [config]);
// update text data for certain attr changes
var attrs = ['width', 'height', 'text', 'textStroke', 'textStrokeWidth'];
var attrs = ['width', 'height', 'padding', 'text', 'textStroke', 'textStrokeWidth'];
var that = this;
for(var n = 0; n < attrs.length; n++) {
var attr = attrs[n];
this.on(attr + 'Change', function(evt) {
that._setTextData();
});
this.on(attr + 'Change', that._setTextData);
}
that._setTextData();

File diff suppressed because one or more lines are too long

View File

@ -94,13 +94,11 @@ Kinetic.Text = function(config) {
Kinetic.Shape.apply(this, [config]);
// update text data for certain attr changes
var attrs = ['width', 'height', 'text', 'textStroke', 'textStrokeWidth'];
var attrs = ['width', 'height', 'padding', 'text', 'textStroke', 'textStrokeWidth'];
var that = this;
for(var n = 0; n < attrs.length; n++) {
var attr = attrs[n];
this.on(attr + 'Change', function(evt) {
that._setTextData();
});
this.on(attr + 'Change', that._setTextData);
}
that._setTextData();