commit
489e9359ed
1 changed files with 10 additions and 4 deletions
|
@ -1482,13 +1482,19 @@ proc fillPath*(
|
||||||
windingRule = wrNonZero,
|
windingRule = wrNonZero,
|
||||||
) =
|
) =
|
||||||
## Fills a path.
|
## Fills a path.
|
||||||
var mask = newMask(image.width, image.height)
|
if paint.kind == pkSolid:
|
||||||
var fill = newImage(image.width, image.height)
|
image.fillPath(path, paint.color)
|
||||||
|
return
|
||||||
|
|
||||||
|
let
|
||||||
|
mask = newMask(image.width, image.height)
|
||||||
|
fill = newImage(image.width, image.height)
|
||||||
|
|
||||||
mask.fillPath(parseSomePath(path), windingRule)
|
mask.fillPath(parseSomePath(path), windingRule)
|
||||||
|
|
||||||
case paint.kind:
|
case paint.kind:
|
||||||
of pkSolid:
|
of pkSolid:
|
||||||
fill.fill(paint.color)
|
discard # Handled above
|
||||||
of pkImage:
|
of pkImage:
|
||||||
fill.draw(paint.image, paint.imageMat)
|
fill.draw(paint.image, paint.imageMat)
|
||||||
of pkImageTiled:
|
of pkImageTiled:
|
||||||
|
@ -1514,7 +1520,7 @@ proc fillPath*(
|
||||||
paint.gradientStops
|
paint.gradientStops
|
||||||
)
|
)
|
||||||
|
|
||||||
fill.draw(mask, blendMode = bmMask)
|
fill.draw(mask)
|
||||||
image.draw(fill, blendMode = paint.blendMode)
|
image.draw(fill, blendMode = paint.blendMode)
|
||||||
|
|
||||||
proc strokePath*(
|
proc strokePath*(
|
||||||
|
|
Loading…
Reference in a new issue