mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2025-03-13 22:50:01 -04:00
Merge pull request #337 from Jacco/issue/301
Reduce target when fill hole with same color #301
This commit is contained in:
commit
6c6d3a8bfb
2 changed files with 4 additions and 1 deletions
|
@ -49,7 +49,7 @@ const _ungroupLoop = function (group, recursive, setSelectedItems) {
|
|||
// iterate over group children recursively
|
||||
for (let i = 0; i < group.children.length; i++) {
|
||||
let groupChild = group.children[i];
|
||||
if (groupChild.hasChildren()) {
|
||||
if (groupChild instanceof paper.Group && groupChild.hasChildren()) {
|
||||
// recursion (groups can contain groups, ie. from SVG import)
|
||||
if (recursive) {
|
||||
_ungroupLoop(groupChild, recursive, setSelectedItems);
|
||||
|
|
|
@ -122,7 +122,10 @@ class FillTool extends paper.Tool {
|
|||
this.fillItem.parent.fillColor.toCSS() === this.addedFillItem.fillColor.toCSS()) {
|
||||
this.addedFillItem.remove();
|
||||
this.addedFillItem = null;
|
||||
let parent = this.fillItem.parent;
|
||||
this.fillItem.remove();
|
||||
parent = parent.reduce();
|
||||
parent.fillColor = this.fillColor;
|
||||
} else if (this.addedFillItem) {
|
||||
// Fill in a hole.
|
||||
this.addedFillItem.data.noHover = false;
|
||||
|
|
Loading…
Reference in a new issue