mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-08 22:01:58 -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
|
}, new function() { // Injection scope for PostScript-like drawing functions
|
||||||
function getCurrentPath(that) {
|
function getCurrentPath(that) {
|
||||||
if (that._children.length) {
|
if (!that._children.length)
|
||||||
return that._children[that._children.length - 1];
|
|
||||||
} else {
|
|
||||||
throw new Error('Use a moveTo() command first');
|
throw new Error('Use a moveTo() command first');
|
||||||
}
|
return that._children[that._children.length - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
var fields = {
|
var fields = {
|
||||||
|
|
Loading…
Reference in a new issue