mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
Shorten getCurrentPath().
This commit is contained in:
parent
dff0c595f0
commit
c4c4f51eb9
1 changed files with 2 additions and 4 deletions
|
@ -77,11 +77,9 @@ var CompoundPath = this.CompoundPath = PathItem.extend({
|
|||
}
|
||||
}, new function() { // Injection scope for PostScript-like drawing functions
|
||||
function getCurrentPath(that) {
|
||||
if (that._children.length) {
|
||||
return that._children[that._children.length - 1];
|
||||
} else {
|
||||
if (!that._children.length)
|
||||
throw new Error('Use a moveTo() command first');
|
||||
}
|
||||
return that._children[that._children.length - 1];
|
||||
}
|
||||
|
||||
var fields = {
|
||||
|
|
Loading…
Reference in a new issue