scratch-paint/src/helper/compound-path.js

28 lines
517 B
JavaScript
Raw Normal View History

2017-09-11 14:23:30 -04:00
const isCompoundPath = function (item) {
return item && item.className === 'CompoundPath';
};
const isCompoundPathChild = function (item) {
if (item.parent) {
return item.parent.className === 'CompoundPath';
}
return false;
};
const getItemsCompoundPath = function (item) {
const itemParent = item.parent;
if (isCompoundPath(itemParent)) {
return itemParent;
}
return null;
};
export {
isCompoundPath,
isCompoundPathChild,
getItemsCompoundPath
};