remove code
This commit is contained in:
parent
750cdc4814
commit
7b02ca4dd5
2 changed files with 25 additions and 65 deletions
|
@ -174,7 +174,7 @@ proc draw(
|
||||||
if ctx.fill != ColorRGBA():
|
if ctx.fill != ColorRGBA():
|
||||||
img.fillPath(path, ctx.fill, ctx.transform, ctx.fillRule)
|
img.fillPath(path, ctx.fill, ctx.transform, ctx.fillRule)
|
||||||
if ctx.stroke != ColorRGBA() and ctx.strokeWidth > 0:
|
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":
|
of "line":
|
||||||
let
|
let
|
||||||
|
@ -192,7 +192,7 @@ proc draw(
|
||||||
if ctx.fill != ColorRGBA():
|
if ctx.fill != ColorRGBA():
|
||||||
img.fillPath(path, ctx.fill, ctx.transform)
|
img.fillPath(path, ctx.fill, ctx.transform)
|
||||||
if ctx.stroke != ColorRGBA() and ctx.strokeWidth > 0:
|
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":
|
of "polyline", "polygon":
|
||||||
let
|
let
|
||||||
|
@ -221,7 +221,7 @@ proc draw(
|
||||||
if ctx.fill != ColorRGBA():
|
if ctx.fill != ColorRGBA():
|
||||||
img.fillPath(path, ctx.fill, ctx.transform)
|
img.fillPath(path, ctx.fill, ctx.transform)
|
||||||
if ctx.stroke != ColorRGBA() and ctx.strokeWidth > 0:
|
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":
|
of "rect":
|
||||||
let
|
let
|
||||||
|
@ -259,7 +259,7 @@ proc draw(
|
||||||
if ctx.fill != ColorRGBA():
|
if ctx.fill != ColorRGBA():
|
||||||
img.fillPath(path, ctx.fill, ctx.transform)
|
img.fillPath(path, ctx.fill, ctx.transform)
|
||||||
if ctx.stroke != ColorRGBA() and ctx.strokeWidth > 0:
|
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":
|
of "circle", "ellipse":
|
||||||
let
|
let
|
||||||
|
@ -281,7 +281,7 @@ proc draw(
|
||||||
if ctx.fill != ColorRGBA():
|
if ctx.fill != ColorRGBA():
|
||||||
img.fillPath(path, ctx.fill, ctx.transform)
|
img.fillPath(path, ctx.fill, ctx.transform)
|
||||||
if ctx.stroke != ColorRGBA() and ctx.strokeWidth > 0:
|
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:
|
else:
|
||||||
raise newException(PixieError, "Unsupported SVG tag: " & node.tag & ".")
|
raise newException(PixieError, "Unsupported SVG tag: " & node.tag & ".")
|
||||||
|
|
|
@ -1269,28 +1269,17 @@ proc fillPath*(
|
||||||
image: Image,
|
image: Image,
|
||||||
path: SomePath,
|
path: SomePath,
|
||||||
color: ColorRGBA,
|
color: ColorRGBA,
|
||||||
pos: Vec2,
|
transform: Vec2 | Mat3,
|
||||||
windingRule = wrNonZero,
|
windingRule = wrNonZero,
|
||||||
blendMode = bmNormal
|
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
|
when type(transform) is Vec2:
|
||||||
image.fillShapes(shapes, color, windingRule, blendMode)
|
segment += transform
|
||||||
|
else:
|
||||||
proc fillPath*(
|
segment = transform * segment
|
||||||
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
|
|
||||||
image.fillShapes(shapes, color, windingRule, blendMode)
|
image.fillShapes(shapes, color, windingRule, blendMode)
|
||||||
|
|
||||||
proc fillPath*(
|
proc fillPath*(
|
||||||
|
@ -1303,27 +1292,18 @@ proc fillPath*(
|
||||||
proc fillPath*(
|
proc fillPath*(
|
||||||
mask: Mask,
|
mask: Mask,
|
||||||
path: SomePath,
|
path: SomePath,
|
||||||
pos: Vec2,
|
transform: Vec2 | Mat3,
|
||||||
windingRule = wrNonZero
|
windingRule = wrNonZero
|
||||||
) =
|
) =
|
||||||
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
|
when type(transform) is Vec2:
|
||||||
|
segment += transform
|
||||||
|
else:
|
||||||
|
segment = transform * segment
|
||||||
mask.fillShapes(shapes, color, windingRule)
|
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*(
|
proc strokePath*(
|
||||||
image: Image,
|
image: Image,
|
||||||
path: SomePath,
|
path: SomePath,
|
||||||
|
@ -1338,28 +1318,17 @@ proc strokePath*(
|
||||||
image: Image,
|
image: Image,
|
||||||
path: SomePath,
|
path: SomePath,
|
||||||
color: ColorRGBA,
|
color: ColorRGBA,
|
||||||
|
transform: Vec2 | Mat3,
|
||||||
strokeWidth = 1.0,
|
strokeWidth = 1.0,
|
||||||
pos: Vec2,
|
|
||||||
blendMode = bmNormal
|
blendMode = bmNormal
|
||||||
) =
|
) =
|
||||||
var strokeShapes = strokeShapes(parseSomePath(path), strokeWidth)
|
var strokeShapes = strokeShapes(parseSomePath(path), strokeWidth)
|
||||||
for shape in strokeShapes.mitems:
|
for shape in strokeShapes.mitems:
|
||||||
for segment in shape.mitems:
|
for segment in shape.mitems:
|
||||||
segment += pos
|
when type(transform) is Vec2:
|
||||||
image.fillShapes(strokeShapes, color, wrNonZero, blendMode)
|
segment += transform
|
||||||
|
else:
|
||||||
proc strokePath*(
|
segment = transform * segment
|
||||||
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
|
|
||||||
image.fillShapes(strokeShapes, color, wrNonZero, blendMode)
|
image.fillShapes(strokeShapes, color, wrNonZero, blendMode)
|
||||||
|
|
||||||
proc strokePath*(
|
proc strokePath*(
|
||||||
|
@ -1374,24 +1343,15 @@ proc strokePath*(
|
||||||
mask: Mask,
|
mask: Mask,
|
||||||
path: SomePath,
|
path: SomePath,
|
||||||
strokeWidth = 1.0,
|
strokeWidth = 1.0,
|
||||||
pos: Vec2
|
transform: Vec2 | Mat3
|
||||||
) =
|
) =
|
||||||
var strokeShapes = strokeShapes(parseSomePath(path), strokeWidth)
|
var strokeShapes = strokeShapes(parseSomePath(path), strokeWidth)
|
||||||
for shape in strokeShapes.mitems:
|
for shape in strokeShapes.mitems:
|
||||||
for segment in shape.mitems:
|
for segment in shape.mitems:
|
||||||
segment += pos
|
when type(transform) is Vec2:
|
||||||
mask.fillShapes(strokeShapes, wrNonZero)
|
segment += transform
|
||||||
|
else:
|
||||||
proc strokePath*(
|
segment = transform * segment
|
||||||
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
|
|
||||||
mask.fillShapes(strokeShapes, wrNonZero)
|
mask.fillShapes(strokeShapes, wrNonZero)
|
||||||
|
|
||||||
when defined(release):
|
when defined(release):
|
||||||
|
|
Loading…
Reference in a new issue