Allow erase through groups

This commit is contained in:
DD 2017-10-19 11:43:16 -04:00
parent 09ef88cac1
commit e425fc6dcb

View file

@ -195,7 +195,8 @@ class Blobbiness {
// Get all path items to merge with // Get all path items to merge with
const paths = paper.project.getItems({ const paths = paper.project.getItems({
match: function (item) { match: function (item) {
return blob.isMergeable(lastPath, item); return blob.isMergeable(lastPath, item) &&
item.parent instanceof paper.Layer; // don't merge with nested in group
} }
}); });
@ -390,8 +391,7 @@ class Blobbiness {
isMergeable (newPath, existingPath) { isMergeable (newPath, existingPath) {
return existingPath instanceof paper.PathItem && // path or compound path return existingPath instanceof paper.PathItem && // path or compound path
existingPath !== this.cursorPreview && // don't merge with the mouse preview existingPath !== this.cursorPreview && // don't merge with the mouse preview
existingPath !== newPath && // don't merge with self existingPath !== newPath; // don't merge with self
existingPath.parent instanceof paper.Layer; // don't merge with nested in group
} }
deactivateTool () { deactivateTool () {