mirror of
https://github.com/scratchfoundation/scratch-paint.git
synced 2025-03-13 22:50:01 -04:00
Merge pull request #360 from fsih/fillTransparentText
Add ability to fill transparent text
This commit is contained in:
commit
6252366759
2 changed files with 8 additions and 3 deletions
|
@ -26,7 +26,7 @@
|
|||
"react-dom": "^16"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@scratch/paper": "0.11.20180329192534",
|
||||
"@scratch/paper": "0.11.20180411183636",
|
||||
"autoprefixer": "8.1.0",
|
||||
"babel-cli": "6.26.0",
|
||||
"babel-core": "^6.23.1",
|
||||
|
|
|
@ -44,8 +44,13 @@ class FillTool extends paper.Tool {
|
|||
fill: true,
|
||||
guide: false,
|
||||
match: function (hitResult) {
|
||||
return (hitResult.item instanceof paper.Path || hitResult.item instanceof paper.PointText) &&
|
||||
(hitResult.item.hasFill() || hitResult.item.closed || isAlmostClosedPath(hitResult.item));
|
||||
if (hitResult.item instanceof paper.Path &&
|
||||
(hitResult.item.hasFill() || hitResult.item.closed || isAlmostClosedPath(hitResult.item))) {
|
||||
return true;
|
||||
}
|
||||
if (hitResult.item instanceof paper.PointText) {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
hitUnfilledPaths: true,
|
||||
tolerance: FillTool.TOLERANCE / paper.view.zoom
|
||||
|
|
Loading…
Reference in a new issue