mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2024-12-23 14:02:50 -05:00
Add ability to fill transparent text
This commit is contained in:
parent
7180b2892a
commit
2b840c2f47
1 changed files with 7 additions and 2 deletions
|
@ -44,8 +44,13 @@ class FillTool extends paper.Tool {
|
||||||
fill: true,
|
fill: true,
|
||||||
guide: false,
|
guide: false,
|
||||||
match: function (hitResult) {
|
match: function (hitResult) {
|
||||||
return (hitResult.item instanceof paper.Path || hitResult.item instanceof paper.PointText) &&
|
if (hitResult.item instanceof paper.Path &&
|
||||||
(hitResult.item.hasFill() || hitResult.item.closed || isAlmostClosedPath(hitResult.item));
|
(hitResult.item.hasFill() || hitResult.item.closed || isAlmostClosedPath(hitResult.item))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (hitResult.item instanceof paper.PointText) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
hitUnfilledPaths: true,
|
hitUnfilledPaths: true,
|
||||||
tolerance: FillTool.TOLERANCE / paper.view.zoom
|
tolerance: FillTool.TOLERANCE / paper.view.zoom
|
||||||
|
|
Loading…
Reference in a new issue