mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00
added getNodeType() and getShapeType() methods
This commit is contained in:
@@ -926,6 +926,14 @@
|
||||
go._addName(this, name);
|
||||
this.setAttr(NAME, name);
|
||||
},
|
||||
/**
|
||||
* get node type. Returns 'Stage', 'Layer', 'Group', or 'Shape'
|
||||
* @name getNodeType
|
||||
* @methodOf Kinetic.Node.prototype
|
||||
*/
|
||||
getNodeType: function() {
|
||||
return this.nodeType;
|
||||
},
|
||||
setAttr: function(key, val) {
|
||||
var oldVal;
|
||||
if(val !== undefined) {
|
||||
|
@@ -163,6 +163,14 @@
|
||||
disableDashArray: function() {
|
||||
this.setAttr('dashArrayEnabled', false);
|
||||
},
|
||||
/**
|
||||
* get shape type. Ex. 'Circle', 'Rect', 'Text', etc.
|
||||
* @name getShapeType
|
||||
* @methodOf Kinetic.Shape.prototype
|
||||
*/
|
||||
getShapeType: function() {
|
||||
return this.shapeType;
|
||||
},
|
||||
remove: function() {
|
||||
Kinetic.Node.prototype.remove.call(this);
|
||||
delete Kinetic.Global.shapes[this.colorKey];
|
||||
|
Reference in New Issue
Block a user