Switch back to instanceof checks.

As people are started to subclass Paper.js classes...
This commit is contained in:
Jürg Lehni 2013-12-09 15:04:44 +01:00
parent e238d23194
commit 44e913201d
2 changed files with 2 additions and 3 deletions

View file

@ -1626,8 +1626,7 @@ 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 && parent._type === 'compound-path'
? parent : this)._style;
return (parent && parent instanceof CompoundPath ? parent : this)._style;
},
// DOCS: toShape

View file

@ -175,7 +175,7 @@ var Style = Base.extend(new function() {
// they all have the same style.
// If true is passed for dontMerge, don't merge children styles
if (!children || children.length === 0 || arguments[0]
|| this._item._type === 'compound-path') {
|| this._item instanceof CompoundPath) {
var value = this._values[key];
if (value === undefined) {
value = this._defaults[key];