mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 15:23:44 +08:00
added padding attr change event binding to Text
This commit is contained in:
parent
39e8a7af8d
commit
66f29c602e
6
dist/kinetic-core.js
vendored
6
dist/kinetic-core.js
vendored
@ -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();
|
||||
|
2
dist/kinetic-core.min.js
vendored
2
dist/kinetic-core.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user