mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
Move Path#getStyle() to better location and simplify code.
This commit is contained in:
parent
451ff4fd03
commit
38d67d843d
1 changed files with 6 additions and 6 deletions
|
@ -152,6 +152,12 @@ var Path = PathItem.extend(/** @lends Path# */{
|
|||
}
|
||||
},
|
||||
|
||||
getStyle: function() {
|
||||
// If this path is part of a CompoundPath, use the paren't style instead
|
||||
var parent = this._parent;
|
||||
return (parent instanceof CompoundPath ? parent : this)._style;
|
||||
},
|
||||
|
||||
/**
|
||||
* The segments contained within the path.
|
||||
*
|
||||
|
@ -1623,12 +1629,6 @@ var Path = PathItem.extend(/** @lends Path# */{
|
|||
return this.getNearestLocation(point).getPoint();
|
||||
},
|
||||
|
||||
getStyle: function() {
|
||||
// If this path is part of a CompoundPath, use the paren't style instead
|
||||
var parent = this._parent;
|
||||
return (parent && parent instanceof CompoundPath ? parent : this)._style;
|
||||
},
|
||||
|
||||
// DOCS: toShape
|
||||
|
||||
toShape: function(insert) {
|
||||
|
|
Loading…
Reference in a new issue