2012-12-02 04:04:10 +08:00
|
|
|
(function() {
|
2013-12-06 14:29:50 +08:00
|
|
|
var SPACE = '',
|
|
|
|
TRANSFORM_CHANGE_STR = [
|
|
|
|
'xChange.kinetic',
|
|
|
|
'yChange.kinetic',
|
|
|
|
'scaleXChange.kinetic',
|
|
|
|
'scaleYChange.kinetic',
|
|
|
|
'skewXChange.kinetic',
|
|
|
|
'skewYChange.kinetic',
|
|
|
|
'rotationChange.kinetic',
|
|
|
|
'offsetXChange.kinetic',
|
|
|
|
'offsetYChange.kinetic'
|
|
|
|
].join(SPACE);
|
|
|
|
|
2013-05-08 14:51:02 +08:00
|
|
|
Kinetic.Util.addMethods(Kinetic.Container, {
|
2013-07-23 12:41:41 +08:00
|
|
|
__init: function(config) {
|
2013-05-20 12:07:43 +08:00
|
|
|
this.children = new Kinetic.Collection();
|
2012-12-02 04:04:10 +08:00
|
|
|
Kinetic.Node.call(this, config);
|
2013-12-06 14:29:50 +08:00
|
|
|
|
|
|
|
this.on(TRANSFORM_CHANGE_STR, function() {
|
|
|
|
var stage = this.getStage();
|
|
|
|
if (stage) {
|
|
|
|
stage._enableNestedTransforms = true;
|
|
|
|
}
|
|
|
|
});
|
2012-12-02 04:04:10 +08:00
|
|
|
},
|
|
|
|
/**
|
2013-05-20 12:07:43 +08:00
|
|
|
* returns a {@link Kinetic.Collection} of direct descendant nodes
|
2013-05-16 00:27:22 +08:00
|
|
|
* @method
|
|
|
|
* @memberof Kinetic.Container.prototype
|
2012-12-02 04:04:10 +08:00
|
|
|
*/
|
|
|
|
getChildren: function() {
|
|
|
|
return this.children;
|
|
|
|
},
|
2013-06-07 13:45:31 +08:00
|
|
|
/**
|
|
|
|
* determine if node has children
|
|
|
|
* @method
|
|
|
|
* @memberof Kinetic.Container.prototype
|
|
|
|
*/
|
|
|
|
hasChildren: function() {
|
|
|
|
return this.getChildren().length > 0;
|
|
|
|
},
|
2012-12-02 04:04:10 +08:00
|
|
|
/**
|
|
|
|
* remove all children
|
2013-05-16 00:27:22 +08:00
|
|
|
* @method
|
|
|
|
* @memberof Kinetic.Container.prototype
|
2012-12-02 04:04:10 +08:00
|
|
|
*/
|
|
|
|
removeChildren: function() {
|
2013-06-07 13:45:31 +08:00
|
|
|
var children = this.children,
|
|
|
|
child;
|
|
|
|
|
|
|
|
while(children.length > 0) {
|
2013-07-12 07:47:33 +08:00
|
|
|
child = children[0];
|
2013-06-07 13:45:31 +08:00
|
|
|
if (child.hasChildren()) {
|
|
|
|
child.removeChildren();
|
|
|
|
}
|
|
|
|
child.remove();
|
2012-12-02 04:04:10 +08:00
|
|
|
}
|
2013-06-07 13:45:31 +08:00
|
|
|
|
|
|
|
return this;
|
2012-12-02 04:04:10 +08:00
|
|
|
},
|
2013-06-07 14:03:00 +08:00
|
|
|
/**
|
|
|
|
* destroy all children
|
|
|
|
* @method
|
|
|
|
* @memberof Kinetic.Container.prototype
|
|
|
|
*/
|
|
|
|
destroyChildren: function() {
|
2013-06-09 06:57:36 +08:00
|
|
|
var children = this.children;
|
2013-06-07 14:03:00 +08:00
|
|
|
while(children.length > 0) {
|
2013-06-09 06:57:36 +08:00
|
|
|
children[0].destroy();
|
2013-06-07 14:03:00 +08:00
|
|
|
}
|
|
|
|
return this;
|
|
|
|
},
|
2012-12-02 04:04:10 +08:00
|
|
|
/**
|
|
|
|
* add node to container
|
2013-05-16 00:27:22 +08:00
|
|
|
* @method
|
|
|
|
* @memberof Kinetic.Container.prototype
|
2012-12-02 04:04:10 +08:00
|
|
|
* @param {Node} child
|
|
|
|
*/
|
|
|
|
add: function(child) {
|
2013-09-09 13:02:04 +08:00
|
|
|
var children = this.children;
|
2013-07-23 13:47:13 +08:00
|
|
|
|
|
|
|
this._validateAdd(child);
|
2012-12-02 04:04:10 +08:00
|
|
|
child.index = children.length;
|
|
|
|
child.parent = this;
|
|
|
|
children.push(child);
|
2013-05-21 13:12:43 +08:00
|
|
|
this._fire('add', {
|
2013-05-21 12:58:57 +08:00
|
|
|
child: child
|
2013-05-21 13:12:43 +08:00
|
|
|
});
|
2012-12-02 04:04:10 +08:00
|
|
|
|
|
|
|
// chainable
|
|
|
|
return this;
|
|
|
|
},
|
2013-06-09 06:57:36 +08:00
|
|
|
destroy: function() {
|
|
|
|
// destroy children
|
|
|
|
if (this.hasChildren()) {
|
|
|
|
this.destroyChildren();
|
|
|
|
}
|
|
|
|
// then destroy self
|
|
|
|
Kinetic.Node.prototype.destroy.call(this);
|
|
|
|
},
|
2012-12-02 04:04:10 +08:00
|
|
|
/**
|
2013-05-19 01:40:05 +08:00
|
|
|
* return a {@link Kinetic.Collection} of nodes that match the selector. Use '#' for id selections
|
2013-07-04 03:53:44 +08:00
|
|
|
* and '.' for name selections. You can also select by type or class name. Pass multiple selectors
|
|
|
|
* separated by a space.
|
2013-05-16 00:27:22 +08:00
|
|
|
* @method
|
|
|
|
* @memberof Kinetic.Container.prototype
|
2012-12-02 04:04:10 +08:00
|
|
|
* @param {String} selector
|
2013-05-19 01:40:05 +08:00
|
|
|
* @example
|
|
|
|
* // select node with id foo<br>
|
2013-09-21 05:08:51 +08:00
|
|
|
* var node = stage.find('#foo');<br><br>
|
2013-05-19 01:40:05 +08:00
|
|
|
*
|
|
|
|
* // select nodes with name bar inside layer<br>
|
2013-09-21 05:08:51 +08:00
|
|
|
* var nodes = layer.find('.bar');<br><br>
|
2013-05-19 01:40:05 +08:00
|
|
|
*
|
|
|
|
* // select all groups inside layer<br>
|
2013-09-21 05:08:51 +08:00
|
|
|
* var nodes = layer.find('Group');<br><br>
|
2013-05-19 01:40:05 +08:00
|
|
|
*
|
|
|
|
* // select all rectangles inside layer<br>
|
2013-09-21 05:08:51 +08:00
|
|
|
* var nodes = layer.find('Rect');<br><br>
|
2013-07-04 03:53:44 +08:00
|
|
|
*
|
|
|
|
* // select node with an id of foo or a name of bar inside layer<br>
|
2013-09-21 05:08:51 +08:00
|
|
|
* var nodes = layer.find('#foo, .bar');
|
2012-12-02 04:04:10 +08:00
|
|
|
*/
|
2013-09-21 05:08:51 +08:00
|
|
|
find: function(selector) {
|
2013-07-22 07:05:40 +08:00
|
|
|
var retArr = [],
|
|
|
|
selectorArr = selector.replace(/ /g, '').split(','),
|
|
|
|
len = selectorArr.length,
|
|
|
|
n, i, sel, arr, node, children, clen;
|
|
|
|
|
|
|
|
for (n = 0; n < len; n++) {
|
|
|
|
sel = selectorArr[n];
|
|
|
|
|
|
|
|
// id selector
|
|
|
|
if(sel.charAt(0) === '#') {
|
|
|
|
node = this._getNodeById(sel.slice(1));
|
2013-07-04 03:53:44 +08:00
|
|
|
if(node) {
|
2013-07-22 07:05:40 +08:00
|
|
|
retArr.push(node);
|
2013-07-04 03:53:44 +08:00
|
|
|
}
|
2012-12-02 04:04:10 +08:00
|
|
|
}
|
2013-07-04 03:53:44 +08:00
|
|
|
// name selector
|
2013-07-22 07:05:40 +08:00
|
|
|
else if(sel.charAt(0) === '.') {
|
|
|
|
arr = this._getNodesByName(sel.slice(1));
|
|
|
|
retArr = retArr.concat(arr);
|
2013-07-04 03:53:44 +08:00
|
|
|
}
|
|
|
|
// unrecognized selector, pass to children
|
|
|
|
else {
|
2013-07-22 07:05:40 +08:00
|
|
|
children = this.getChildren();
|
|
|
|
clen = children.length;
|
|
|
|
for(i = 0; i < clen; i++) {
|
|
|
|
retArr = retArr.concat(children[i]._get(sel));
|
2013-07-04 03:53:44 +08:00
|
|
|
}
|
2012-12-02 04:04:10 +08:00
|
|
|
}
|
|
|
|
}
|
2013-07-22 07:05:40 +08:00
|
|
|
|
|
|
|
return Kinetic.Collection.toCollection(retArr);
|
2012-12-02 04:04:10 +08:00
|
|
|
},
|
|
|
|
_getNodeById: function(key) {
|
2013-09-09 13:02:04 +08:00
|
|
|
var node = Kinetic.ids[key];
|
2013-09-21 05:08:51 +08:00
|
|
|
|
2013-01-14 03:10:49 +08:00
|
|
|
if(node !== undefined && this.isAncestorOf(node)) {
|
|
|
|
return node;
|
2012-12-02 04:04:10 +08:00
|
|
|
}
|
|
|
|
return null;
|
|
|
|
},
|
|
|
|
_getNodesByName: function(key) {
|
2013-09-09 13:02:04 +08:00
|
|
|
var arr = Kinetic.names[key] || [];
|
2012-12-02 04:04:10 +08:00
|
|
|
return this._getDescendants(arr);
|
|
|
|
},
|
|
|
|
_get: function(selector) {
|
|
|
|
var retArr = Kinetic.Node.prototype._get.call(this, selector);
|
2012-10-07 05:35:46 +08:00
|
|
|
var children = this.getChildren();
|
2012-11-14 16:18:49 +08:00
|
|
|
var len = children.length;
|
|
|
|
for(var n = 0; n < len; n++) {
|
2012-10-07 05:35:46 +08:00
|
|
|
retArr = retArr.concat(children[n]._get(selector));
|
|
|
|
}
|
2012-12-02 04:04:10 +08:00
|
|
|
return retArr;
|
|
|
|
},
|
|
|
|
// extenders
|
|
|
|
toObject: function() {
|
|
|
|
var obj = Kinetic.Node.prototype.toObject.call(this);
|
2012-10-04 10:38:12 +08:00
|
|
|
|
2012-12-02 04:04:10 +08:00
|
|
|
obj.children = [];
|
2012-10-04 10:38:12 +08:00
|
|
|
|
2012-12-02 04:04:10 +08:00
|
|
|
var children = this.getChildren();
|
|
|
|
var len = children.length;
|
|
|
|
for(var n = 0; n < len; n++) {
|
|
|
|
var child = children[n];
|
|
|
|
obj.children.push(child.toObject());
|
2012-04-09 12:26:13 +08:00
|
|
|
}
|
|
|
|
|
2012-12-02 04:04:10 +08:00
|
|
|
return obj;
|
|
|
|
},
|
|
|
|
_getDescendants: function(arr) {
|
|
|
|
var retArr = [];
|
|
|
|
var len = arr.length;
|
|
|
|
for(var n = 0; n < len; n++) {
|
|
|
|
var node = arr[n];
|
|
|
|
if(this.isAncestorOf(node)) {
|
|
|
|
retArr.push(node);
|
|
|
|
}
|
2012-04-09 12:26:13 +08:00
|
|
|
}
|
|
|
|
|
2012-12-02 04:04:10 +08:00
|
|
|
return retArr;
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
* determine if node is an ancestor
|
|
|
|
* of descendant
|
2013-05-16 00:27:22 +08:00
|
|
|
* @method
|
|
|
|
* @memberof Kinetic.Container.prototype
|
2012-12-02 04:04:10 +08:00
|
|
|
* @param {Kinetic.Node} node
|
|
|
|
*/
|
|
|
|
isAncestorOf: function(node) {
|
|
|
|
var parent = node.getParent();
|
|
|
|
while(parent) {
|
|
|
|
if(parent._id === this._id) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
parent = parent.getParent();
|
|
|
|
}
|
2012-09-26 03:06:02 +08:00
|
|
|
|
2012-12-02 04:04:10 +08:00
|
|
|
return false;
|
|
|
|
},
|
|
|
|
clone: function(obj) {
|
|
|
|
// call super method
|
2013-05-20 12:07:43 +08:00
|
|
|
var node = Kinetic.Node.prototype.clone.call(this, obj);
|
2012-07-07 12:45:18 +08:00
|
|
|
|
2013-05-20 12:07:43 +08:00
|
|
|
this.getChildren().each(function(no) {
|
|
|
|
node.add(no.clone());
|
|
|
|
});
|
2012-12-02 04:04:10 +08:00
|
|
|
return node;
|
|
|
|
},
|
|
|
|
/**
|
2013-05-18 07:20:37 +08:00
|
|
|
* get all shapes that intersect a point. Note: because this method must clear a temporary
|
2013-07-22 07:05:40 +08:00
|
|
|
* canvas and redraw every shape inside the container, it should only be used for special sitations
|
2013-05-18 07:20:37 +08:00
|
|
|
* because it performs very poorly. Please use the {@link Kinetic.Stage#getIntersection} method if at all possible
|
|
|
|
* because it performs much better
|
2013-05-16 00:27:22 +08:00
|
|
|
* @method
|
|
|
|
* @memberof Kinetic.Container.prototype
|
2013-05-18 06:50:53 +08:00
|
|
|
* @param {Object} pos
|
2013-12-03 13:25:20 +08:00
|
|
|
* @param {Number} pos.x
|
|
|
|
* @param {Number} pos.y
|
|
|
|
* @returns {Array} array of shapes
|
2012-12-02 04:04:10 +08:00
|
|
|
*/
|
2013-12-03 13:25:20 +08:00
|
|
|
getAllIntersections: function(pos) {
|
2012-12-02 04:04:10 +08:00
|
|
|
var arr = [];
|
2012-07-07 12:45:18 +08:00
|
|
|
|
2013-12-03 13:25:20 +08:00
|
|
|
this.find('Shape').each(function(shape) {
|
2012-12-02 04:04:10 +08:00
|
|
|
if(shape.isVisible() && shape.intersects(pos)) {
|
|
|
|
arr.push(shape);
|
|
|
|
}
|
2013-12-03 13:25:20 +08:00
|
|
|
});
|
2012-12-02 04:04:10 +08:00
|
|
|
|
|
|
|
return arr;
|
|
|
|
},
|
|
|
|
_setChildrenIndices: function() {
|
2013-09-15 02:02:47 +08:00
|
|
|
this.children.each(function(child, n) {
|
|
|
|
child.index = n;
|
|
|
|
});
|
2012-12-02 04:04:10 +08:00
|
|
|
},
|
2012-12-11 16:08:59 +08:00
|
|
|
drawScene: function(canvas) {
|
2013-03-22 15:46:41 +08:00
|
|
|
var layer = this.getLayer(),
|
2013-08-11 13:00:29 +08:00
|
|
|
clip = this.getClipWidth() && this.getClipHeight(),
|
2013-04-22 13:42:25 +08:00
|
|
|
children, n, len;
|
2013-07-22 07:05:40 +08:00
|
|
|
|
2013-03-22 15:46:41 +08:00
|
|
|
if (!canvas && layer) {
|
2013-07-22 07:05:40 +08:00
|
|
|
canvas = layer.getCanvas();
|
|
|
|
}
|
2013-03-22 15:46:41 +08:00
|
|
|
|
2012-12-02 04:04:10 +08:00
|
|
|
if(this.isVisible()) {
|
2013-03-22 15:46:41 +08:00
|
|
|
if (clip) {
|
2013-09-01 12:49:18 +08:00
|
|
|
canvas.getContext()._clip(this);
|
2013-03-22 15:46:41 +08:00
|
|
|
}
|
2013-08-26 13:26:42 +08:00
|
|
|
else {
|
|
|
|
this._drawChildren(canvas);
|
2013-03-22 15:46:41 +08:00
|
|
|
}
|
2013-02-16 10:20:34 +08:00
|
|
|
}
|
2013-06-07 13:45:31 +08:00
|
|
|
|
|
|
|
return this;
|
2012-12-02 04:04:10 +08:00
|
|
|
},
|
2013-08-26 13:26:42 +08:00
|
|
|
_drawChildren: function(canvas) {
|
2013-09-15 02:02:47 +08:00
|
|
|
this.children.each(function(child) {
|
|
|
|
child.drawScene(canvas);
|
|
|
|
});
|
2013-08-26 13:26:42 +08:00
|
|
|
},
|
2012-12-02 04:04:10 +08:00
|
|
|
drawHit: function() {
|
2013-09-01 12:49:18 +08:00
|
|
|
var hasClip = this.getClipWidth() && this.getClipHeight() && this.nodeType !== 'Stage',
|
2013-07-22 07:05:40 +08:00
|
|
|
n = 0,
|
|
|
|
len = 0,
|
2013-04-08 01:00:55 +08:00
|
|
|
children = [],
|
2013-02-16 10:20:34 +08:00
|
|
|
hitCanvas;
|
|
|
|
|
2013-03-24 11:02:11 +08:00
|
|
|
if(this.shouldDrawHit()) {
|
2013-09-01 12:49:18 +08:00
|
|
|
if (hasClip) {
|
2013-07-22 07:05:40 +08:00
|
|
|
hitCanvas = this.getLayer().hitCanvas;
|
2013-09-01 12:49:18 +08:00
|
|
|
hitCanvas.getContext()._clip(this);
|
2013-03-24 11:02:11 +08:00
|
|
|
}
|
2013-07-22 07:05:40 +08:00
|
|
|
|
|
|
|
children = this.children;
|
2013-04-08 01:00:55 +08:00
|
|
|
len = children.length;
|
|
|
|
|
|
|
|
for(n = 0; n < len; n++) {
|
2012-12-02 04:04:10 +08:00
|
|
|
children[n].drawHit();
|
|
|
|
}
|
2013-09-01 12:49:18 +08:00
|
|
|
if (hasClip) {
|
|
|
|
hitCanvas.getContext()._context.restore();
|
2013-03-24 11:02:11 +08:00
|
|
|
}
|
2013-02-16 10:20:34 +08:00
|
|
|
}
|
2013-06-07 13:45:31 +08:00
|
|
|
|
|
|
|
return this;
|
2012-10-08 10:14:14 +08:00
|
|
|
}
|
2013-05-08 14:17:57 +08:00
|
|
|
});
|
2013-02-16 10:20:34 +08:00
|
|
|
|
2013-05-08 14:51:02 +08:00
|
|
|
Kinetic.Util.extend(Kinetic.Container, Kinetic.Node);
|
2013-09-21 05:08:51 +08:00
|
|
|
// deprecated methods
|
|
|
|
Kinetic.Container.prototype.get = Kinetic.Container.prototype.find;
|
2013-02-16 10:20:34 +08:00
|
|
|
|
|
|
|
// add getters setters
|
2013-12-05 00:15:04 +08:00
|
|
|
Kinetic.Factory.addBoxGetterSetter(Kinetic.Container, 'clip');
|
2013-02-16 10:20:34 +08:00
|
|
|
|
|
|
|
/**
|
2013-08-11 13:00:29 +08:00
|
|
|
* set clip
|
2013-05-16 00:27:22 +08:00
|
|
|
* @method
|
2013-08-11 13:00:29 +08:00
|
|
|
* @name setClip
|
2013-05-16 00:27:22 +08:00
|
|
|
* @memberof Kinetic.Container.prototype
|
2013-12-03 13:25:20 +08:00
|
|
|
* @param {Object} clip {x:x, y:y, width:width, height:height}
|
2013-08-11 13:00:29 +08:00
|
|
|
* @example
|
2013-12-03 13:25:20 +08:00
|
|
|
* // set clip x, y, width and height<br>
|
2013-08-11 13:00:29 +08:00
|
|
|
* image.setClip({<br>
|
|
|
|
* x: 20,<br>
|
|
|
|
* y: 20,<br>
|
|
|
|
* width: 20,<br>
|
|
|
|
* height: 20<br>
|
|
|
|
* });
|
|
|
|
*/
|
|
|
|
|
2013-12-03 13:25:20 +08:00
|
|
|
/**
|
|
|
|
* get clip
|
|
|
|
* @name getClip
|
2013-08-11 13:00:29 +08:00
|
|
|
* @method
|
|
|
|
* @memberof Kinetic.Container.prototype
|
2013-12-03 13:25:20 +08:00
|
|
|
* @returns {Object}
|
2013-08-11 13:00:29 +08:00
|
|
|
*/
|
|
|
|
|
2013-12-05 00:15:04 +08:00
|
|
|
Kinetic.Factory.addGetterSetter(Kinetic.Container, 'clipX', 0);
|
2013-08-11 13:00:29 +08:00
|
|
|
/**
|
2013-12-03 13:25:20 +08:00
|
|
|
* set clip x
|
2013-08-11 13:00:29 +08:00
|
|
|
* @method
|
2013-12-03 13:25:20 +08:00
|
|
|
* @name setClipX
|
2013-08-11 13:00:29 +08:00
|
|
|
* @memberof Kinetic.Container.prototype
|
2013-12-03 13:25:20 +08:00
|
|
|
* @param {Number} x
|
2013-08-11 13:00:29 +08:00
|
|
|
*/
|
|
|
|
|
2013-12-03 13:25:20 +08:00
|
|
|
/**
|
|
|
|
* get clip x
|
|
|
|
* @name getClipX
|
2013-08-11 13:00:29 +08:00
|
|
|
* @method
|
|
|
|
* @memberof Kinetic.Container.prototype
|
2013-12-03 13:25:20 +08:00
|
|
|
* @returns {Number}
|
2013-08-11 13:00:29 +08:00
|
|
|
*/
|
|
|
|
|
2013-12-05 00:15:04 +08:00
|
|
|
Kinetic.Factory.addGetterSetter(Kinetic.Container, 'clipY', 0);
|
2013-08-11 13:00:29 +08:00
|
|
|
/**
|
2013-12-03 13:25:20 +08:00
|
|
|
* set clip y
|
|
|
|
* @name setClipY
|
2013-08-11 13:00:29 +08:00
|
|
|
* @method
|
|
|
|
* @memberof Kinetic.Container.prototype
|
2013-12-03 13:25:20 +08:00
|
|
|
* @param {Number} y
|
2013-02-16 10:20:34 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2013-12-03 13:25:20 +08:00
|
|
|
* get clip y
|
|
|
|
* @name getClipY
|
2013-05-16 00:27:22 +08:00
|
|
|
* @method
|
|
|
|
* @memberof Kinetic.Container.prototype
|
2013-12-03 13:25:20 +08:00
|
|
|
* @returns {Number}
|
2013-02-16 10:20:34 +08:00
|
|
|
*/
|
2013-08-11 13:00:29 +08:00
|
|
|
|
2013-12-05 00:15:04 +08:00
|
|
|
Kinetic.Factory.addGetterSetter(Kinetic.Container, 'clipWidth', 0);
|
2013-12-03 13:25:20 +08:00
|
|
|
/**
|
|
|
|
* set clip width
|
|
|
|
* @name setClipWidth
|
2013-08-11 13:00:29 +08:00
|
|
|
* @method
|
|
|
|
* @memberof Kinetic.Container.prototype
|
2013-12-03 13:25:20 +08:00
|
|
|
* @param {Number} width
|
2013-08-11 13:00:29 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2013-12-03 13:25:20 +08:00
|
|
|
* get clip width
|
|
|
|
* @name getClipWidth
|
2013-08-11 13:00:29 +08:00
|
|
|
* @method
|
|
|
|
* @memberof Kinetic.Container.prototype
|
2013-12-03 13:25:20 +08:00
|
|
|
* @returns {Number}
|
2013-08-11 13:00:29 +08:00
|
|
|
*/
|
|
|
|
|
2013-12-05 00:15:04 +08:00
|
|
|
Kinetic.Factory.addGetterSetter(Kinetic.Container, 'clipHeight', 0);
|
2013-12-03 13:25:20 +08:00
|
|
|
/**
|
|
|
|
* set clip height
|
|
|
|
* @name setClipHeight
|
2013-08-11 13:00:29 +08:00
|
|
|
* @method
|
|
|
|
* @memberof Kinetic.Container.prototype
|
2013-12-03 13:25:20 +08:00
|
|
|
* @param {Number} height
|
2013-08-11 13:00:29 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* get clip height
|
|
|
|
* @name getClipHeight
|
|
|
|
* @method
|
|
|
|
* @memberof Kinetic.Container.prototype
|
2013-12-03 13:25:20 +08:00
|
|
|
* @returns {Number}
|
2013-08-11 13:00:29 +08:00
|
|
|
*/
|
2012-12-02 04:04:10 +08:00
|
|
|
})();
|