mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-07-27 06:10:14 -04:00
Item: implement #addChild(item), #insertChild(index, item), #insertAbove(item) and #insertBelow(item) Deprecate: #moveAbove, #moveBelow, #appendTop, #appendBottom.
This commit is contained in:
parent
9f7b4b7480
commit
6fc08c6417
7 changed files with 123 additions and 72 deletions
src/path
|
@ -56,7 +56,7 @@ var CompoundPath = this.CompoundPath = PathItem.extend({
|
|||
// TODO: Should this be handled in appendTop / Bottom instead?
|
||||
if (path._clockwise === undefined)
|
||||
path.setClockwise(i < l - 1);
|
||||
this.appendTop(path);
|
||||
this.addChild(path);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -70,7 +70,7 @@ var CompoundPath = this.CompoundPath = PathItem.extend({
|
|||
simplify: function() {
|
||||
if (this._children.length == 1) {
|
||||
var child = this._children[0];
|
||||
child.moveAbove(this);
|
||||
child.insertAbove(this);
|
||||
this.remove();
|
||||
return child;
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ var CompoundPath = this.CompoundPath = PathItem.extend({
|
|||
// all implementing classes.
|
||||
moveTo: function(point) {
|
||||
var path = new Path();
|
||||
this.appendTop(path);
|
||||
this.addChild(path);
|
||||
path.moveTo.apply(path, arguments);
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue