mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-22 21:42:30 -05:00
Merge pull request #73 from fsih/eraseThroughGroups
Allow erase through groups
This commit is contained in:
commit
da15ed392a
1 changed files with 3 additions and 3 deletions
|
@ -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 () {
|
||||||
|
|
Loading…
Reference in a new issue