Move Path#getStyle() to better location and simplify code.

This commit is contained in:
Jürg Lehni 2013-12-28 20:56:44 +01:00
parent 451ff4fd03
commit 38d67d843d

View file

@ -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) {