mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 15:23:44 +08:00
fix #96 setting text to integer data types no longer fails
This commit is contained in:
parent
9fde3036f7
commit
a349fa488c
4
dist/kinetic-core.js
vendored
4
dist/kinetic-core.js
vendored
@ -1489,6 +1489,10 @@ Kinetic.Node.prototype = {
|
||||
that._setAttr(obj[key], 'width', size.width);
|
||||
that._setAttr(obj[key], 'height', size.height);
|
||||
break;
|
||||
case 'text':
|
||||
var str = Kinetic.Type._isString(val) ? val : val.toString();
|
||||
that._setAttr(obj, key, str);
|
||||
break;
|
||||
default:
|
||||
that._setAttr(obj, key, val);
|
||||
break;
|
||||
|
5
dist/kinetic-core.min.js
vendored
5
dist/kinetic-core.min.js
vendored
File diff suppressed because one or more lines are too long
@ -290,6 +290,10 @@ Kinetic.Node.prototype = {
|
||||
that._setAttr(obj[key], 'width', size.width);
|
||||
that._setAttr(obj[key], 'height', size.height);
|
||||
break;
|
||||
case 'text':
|
||||
var str = Kinetic.Type._isString(val) ? val : val.toString();
|
||||
that._setAttr(obj, key, str);
|
||||
break;
|
||||
default:
|
||||
that._setAttr(obj, key, val);
|
||||
break;
|
||||
|
@ -2775,6 +2775,9 @@ Test.prototype.tests = {
|
||||
test(text.getCornerRadius() === 20, 'text box corner radius should be 20');
|
||||
test(text.getDraggable() === false, 'text draggable should be false');
|
||||
|
||||
// test set text to integer
|
||||
text.setText(5);
|
||||
|
||||
//document.body.appendChild(layer.bufferCanvas.element)
|
||||
|
||||
//layer.setListening(false);
|
||||
|
Loading…
Reference in New Issue
Block a user