Merge pull request #120 from guzba/master

remove code
This commit is contained in:
treeform 2021-02-22 21:23:58 -08:00 committed by GitHub
commit 693191840b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 65 deletions

View file

@ -174,7 +174,7 @@ proc draw(
if ctx.fill != ColorRGBA():
img.fillPath(path, ctx.fill, ctx.transform, ctx.fillRule)
if ctx.stroke != ColorRGBA() and ctx.strokeWidth > 0:
img.strokePath(path, ctx.stroke, ctx.strokeWidth, ctx.transform)
img.strokePath(path, ctx.stroke, ctx.transform, ctx.strokeWidth)
of "line":
let
@ -192,7 +192,7 @@ proc draw(
if ctx.fill != ColorRGBA():
img.fillPath(path, ctx.fill, ctx.transform)
if ctx.stroke != ColorRGBA() and ctx.strokeWidth > 0:
img.strokePath(path, ctx.stroke, ctx.strokeWidth, ctx.transform)
img.strokePath(path, ctx.stroke, ctx.transform, ctx.strokeWidth)
of "polyline", "polygon":
let
@ -221,7 +221,7 @@ proc draw(
if ctx.fill != ColorRGBA():
img.fillPath(path, ctx.fill, ctx.transform)
if ctx.stroke != ColorRGBA() and ctx.strokeWidth > 0:
img.strokePath(path, ctx.stroke, ctx.strokeWidth, ctx.transform)
img.strokePath(path, ctx.stroke, ctx.transform, ctx.strokeWidth)
of "rect":
let
@ -259,7 +259,7 @@ proc draw(
if ctx.fill != ColorRGBA():
img.fillPath(path, ctx.fill, ctx.transform)
if ctx.stroke != ColorRGBA() and ctx.strokeWidth > 0:
img.strokePath(path, ctx.stroke, ctx.strokeWidth, ctx.transform)
img.strokePath(path, ctx.stroke, ctx.transform, ctx.strokeWidth)
of "circle", "ellipse":
let
@ -281,7 +281,7 @@ proc draw(
if ctx.fill != ColorRGBA():
img.fillPath(path, ctx.fill, ctx.transform)
if ctx.stroke != ColorRGBA() and ctx.strokeWidth > 0:
img.strokePath(path, ctx.stroke, ctx.strokeWidth, ctx.transform)
img.strokePath(path, ctx.stroke, ctx.transform, ctx.strokeWidth)
else:
raise newException(PixieError, "Unsupported SVG tag: " & node.tag & ".")

View file

@ -1269,28 +1269,17 @@ proc fillPath*(
image: Image,
path: SomePath,
color: ColorRGBA,
pos: Vec2,
transform: Vec2 | Mat3,
windingRule = wrNonZero,
blendMode = bmNormal
) =
var shapes = parseSomePath(path)
for shape in shapes.mitems:
for segment in shape.mitems:
segment += pos
image.fillShapes(shapes, color, windingRule, blendMode)
proc fillPath*(
image: Image,
path: SomePath,
color: ColorRGBA,
mat: Mat3,
windingRule = wrNonZero,
blendMode = bmNormal
) =
var shapes = parseSomePath(path)
for shape in shapes.mitems:
for segment in shape.mitems:
segment = mat * segment
when type(transform) is Vec2:
segment += transform
else:
segment = transform * segment
image.fillShapes(shapes, color, windingRule, blendMode)
proc fillPath*(
@ -1303,27 +1292,18 @@ proc fillPath*(
proc fillPath*(
mask: Mask,
path: SomePath,
pos: Vec2,
transform: Vec2 | Mat3,
windingRule = wrNonZero
) =
var shapes = parseSomePath(path)
for shape in shapes.mitems:
for segment in shape.mitems:
segment += pos
when type(transform) is Vec2:
segment += transform
else:
segment = transform * segment
mask.fillShapes(shapes, color, windingRule)
proc fillPath*(
mask: Mask,
path: SomePath,
mat: Mat3,
windingRule = wrNonZero
) =
var shapes = parseSomePath(path)
for shape in shapes.mitems:
for segment in shape.mitems:
segment = mat * segment
mask.fillShapes(shapes, windingRule)
proc strokePath*(
image: Image,
path: SomePath,
@ -1338,28 +1318,17 @@ proc strokePath*(
image: Image,
path: SomePath,
color: ColorRGBA,
transform: Vec2 | Mat3,
strokeWidth = 1.0,
pos: Vec2,
blendMode = bmNormal
) =
var strokeShapes = strokeShapes(parseSomePath(path), strokeWidth)
for shape in strokeShapes.mitems:
for segment in shape.mitems:
segment += pos
image.fillShapes(strokeShapes, color, wrNonZero, blendMode)
proc strokePath*(
image: Image,
path: SomePath,
color: ColorRGBA,
strokeWidth = 1.0,
mat: Mat3,
blendMode = bmNormal
) =
var strokeShapes = strokeShapes(parseSomePath(path), strokeWidth)
for shape in strokeShapes.mitems:
for segment in shape.mitems:
segment = mat * segment
when type(transform) is Vec2:
segment += transform
else:
segment = transform * segment
image.fillShapes(strokeShapes, color, wrNonZero, blendMode)
proc strokePath*(
@ -1374,24 +1343,15 @@ proc strokePath*(
mask: Mask,
path: SomePath,
strokeWidth = 1.0,
pos: Vec2
transform: Vec2 | Mat3
) =
var strokeShapes = strokeShapes(parseSomePath(path), strokeWidth)
for shape in strokeShapes.mitems:
for segment in shape.mitems:
segment += pos
mask.fillShapes(strokeShapes, wrNonZero)
proc strokePath*(
mask: Mask,
path: SomePath,
strokeWidth = 1.0,
mat: Mat3
) =
var strokeShapes = strokeShapes(parseSomePath(path), strokeWidth)
for shape in strokeShapes.mitems:
for segment in shape.mitems:
segment = mat * segment
when type(transform) is Vec2:
segment += transform
else:
segment = transform * segment
mask.fillShapes(strokeShapes, wrNonZero)
when defined(release):