blend mode after winding rule

This commit is contained in:
Ryan Oldenburg 2021-02-08 12:50:24 -06:00
parent c5ce1a8029
commit d3ab965f0f

View file

@ -889,8 +889,8 @@ proc fillShapes(
image: Image, image: Image,
shapes: seq[seq[Vec2]], shapes: seq[seq[Vec2]],
color: ColorRGBA, color: ColorRGBA,
blendMode: BlendMode, windingRule: WindingRule,
windingRule: WindingRule blendMode: BlendMode
) = ) =
let (topHalf, bottomHalf, fullHeight) = let (topHalf, bottomHalf, fullHeight) =
partitionSegments(shapes, image.height div 2) partitionSegments(shapes, image.height div 2)
@ -1165,38 +1165,38 @@ proc fillPath*(
image: Image, image: Image,
path: SomePath, path: SomePath,
color: ColorRGBA, color: ColorRGBA,
blendMode = bmNormal, windingRule = wrNonZero,
windingRule = wrNonZero blendMode = bmNormal
) {.inline.} = ) {.inline.} =
image.fillShapes(parseSomePath(path), color, blendMode, windingRule) image.fillShapes(parseSomePath(path), color, windingRule, blendMode)
proc fillPath*( proc fillPath*(
image: Image, image: Image,
path: SomePath, path: SomePath,
color: ColorRGBA, color: ColorRGBA,
pos: Vec2, pos: Vec2,
blendMode = bmNormal, windingRule = wrNonZero,
windingRule = wrNonZero blendMode = bmNormal
) = ) =
var shapes = parseSomePath(path) var shapes = parseSomePath(path)
for shape in shapes.mitems: for shape in shapes.mitems:
for segment in shape.mitems: for segment in shape.mitems:
segment += pos segment += pos
image.fillShapes(shapes, color, blendMode, windingRule) image.fillShapes(shapes, color, windingRule, blendMode)
proc fillPath*( proc fillPath*(
image: Image, image: Image,
path: SomePath, path: SomePath,
color: ColorRGBA, color: ColorRGBA,
mat: Mat3, mat: Mat3,
blendMode = bmNormal, windingRule = wrNonZero,
windingRule = wrNonZero blendMode = bmNormal
) = ) =
var shapes = parseSomePath(path) var shapes = parseSomePath(path)
for shape in shapes.mitems: for shape in shapes.mitems:
for segment in shape.mitems: for segment in shape.mitems:
segment = mat * segment segment = mat * segment
image.fillShapes(shapes, color, blendMode, windingRule) image.fillShapes(shapes, color, windingRule, blendMode)
proc fillPath*( proc fillPath*(
mask: Mask, mask: Mask,
@ -1234,15 +1234,15 @@ proc strokePath*(
path: SomePath, path: SomePath,
color: ColorRGBA, color: ColorRGBA,
strokeWidth = 1.0, strokeWidth = 1.0,
blendMode = bmNormal, windingRule = wrNonZero,
windingRule = wrNonZero blendMode = bmNormal
) = ) =
let strokeShapes = strokeShapes( let strokeShapes = strokeShapes(
parseSomePath(path), parseSomePath(path),
strokeWidth, strokeWidth,
windingRule windingRule
) )
image.fillShapes(strokeShapes, color, blendMode, windingRule) image.fillShapes(strokeShapes, color, windingRule, blendMode)
proc strokePath*( proc strokePath*(
image: Image, image: Image,
@ -1250,8 +1250,8 @@ proc strokePath*(
color: ColorRGBA, color: ColorRGBA,
strokeWidth = 1.0, strokeWidth = 1.0,
pos: Vec2, pos: Vec2,
blendMode = bmNormal, windingRule = wrNonZero,
windingRule = wrNonZero blendMode = bmNormal
) = ) =
var strokeShapes = strokeShapes( var strokeShapes = strokeShapes(
parseSomePath(path), parseSomePath(path),
@ -1261,7 +1261,7 @@ proc strokePath*(
for shape in strokeShapes.mitems: for shape in strokeShapes.mitems:
for segment in shape.mitems: for segment in shape.mitems:
segment += pos segment += pos
image.fillShapes(strokeShapes, color, blendMode, windingRule) image.fillShapes(strokeShapes, color, windingRule, blendMode)
proc strokePath*( proc strokePath*(
image: Image, image: Image,
@ -1269,8 +1269,8 @@ proc strokePath*(
color: ColorRGBA, color: ColorRGBA,
strokeWidth = 1.0, strokeWidth = 1.0,
mat: Mat3, mat: Mat3,
blendMode = bmNormal, windingRule = wrNonZero,
windingRule = wrNonZero blendMode = bmNormal
) = ) =
var strokeShapes = strokeShapes( var strokeShapes = strokeShapes(
parseSomePath(path), parseSomePath(path),
@ -1280,7 +1280,7 @@ proc strokePath*(
for shape in strokeShapes.mitems: for shape in strokeShapes.mitems:
for segment in shape.mitems: for segment in shape.mitems:
segment = mat * segment segment = mat * segment
image.fillShapes(strokeShapes, color, blendMode, windingRule) image.fillShapes(strokeShapes, color, windingRule, blendMode)
proc strokePath*( proc strokePath*(
mask: Mask, mask: Mask,