mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-24 22:42:28 -05:00
28 lines
517 B
JavaScript
28 lines
517 B
JavaScript
|
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
|
||
|
};
|