Commit ed8cbf96 authored by Tebjan Halm's avatar Tebjan Halm
Browse files

Merge pull request #2 from mwbowers/master

One change addresses matrix multiplication order for transformations. The other change addresses the calculation of the control point for smooth CurveTos.
parents f07a979d 1b018948
...@@ -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>
......
...@@ -161,7 +161,7 @@ namespace Svg ...@@ -161,7 +161,7 @@ namespace Svg
foreach (SvgTransform transformation in this.Transforms) foreach (SvgTransform transformation in this.Transforms)
{ {
transformMatrix.Multiply(transformation.Matrix); transformMatrix.Multiply(transformation.Matrix, MatrixOrder.Append);
} }
renderer.Transform = transformMatrix; renderer.Transform = transformMatrix;
......
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