mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Use 'that' variable for private instance method.
This commit is contained in:
parent
26ebe2f2c0
commit
1d37c7b76f
1 changed files with 3 additions and 4 deletions
|
@ -77,16 +77,15 @@ CompoundPath = PathItem.extend({
|
|||
}
|
||||
}, new function() {
|
||||
|
||||
function getCurrentPath(compoundPath) {
|
||||
if (compoundPath.children.length) {
|
||||
return compoundPath.children[compoundPath.children.length - 1];
|
||||
function getCurrentPath(that) {
|
||||
if (that.children.length) {
|
||||
return that.children[that.children.length - 1];
|
||||
} else {
|
||||
throw Error('Use a moveTo() command first');
|
||||
}
|
||||
}
|
||||
|
||||
var fields = {
|
||||
|
||||
moveBy: function() {
|
||||
var point = arguments.length ? Point.read(arguments) : new Point();
|
||||
var path = getCurrentPath(this);
|
||||
|
|
Loading…
Reference in a new issue