Add ability to fill transparent text

This commit is contained in:
DD 2018-04-03 18:21:12 -04:00
parent 7180b2892a
commit 2b840c2f47

View file

@ -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