Commit 1b018948 authored by Matt Bowers's avatar Matt Bowers
Browse files

Inverted curves.

When using T, t, S, or s to create curves, the curves were not rendered
properly. The control point was causing the curve to be inverted.
parent 8c10c2e6
...@@ -166,11 +166,28 @@ namespace Svg ...@@ -166,11 +166,28 @@ namespace Svg
private static PointF Reflect(PointF point, PointF mirror) private static PointF Reflect(PointF point, PointF mirror)
{ {
// TODO: Only works left to right??? float x, y, dx, dy;
var x = mirror.X + (mirror.X - point.X); dx = Math.Abs(mirror.X - point.X);
var y = mirror.Y + (mirror.Y - point.Y); dy = Math.Abs(mirror.Y - point.Y);
return new PointF(Math.Abs(x), Math.Abs(y)); if (mirror.X >= point.X)
{
x = mirror.X + dx;
}
else
{
x = mirror.X - dx;
}
if (mirror.Y >= point.Y)
{
y = mirror.Y + dy;
}
else
{
y = mirror.Y - dy;
}
return new PointF(x, y);
} }
/// <summary> /// <summary>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment