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