From 345ac1bf066023b5c664a89fbe4868a91c3ebf6b Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 8 Jun 2017 10:32:07 +1000 Subject: [PATCH] [SL.Core] Fix naming --- ...x2Extentions.cs => Matrix3x2Extensions.cs} | 30 +++++++++---------- .../SixLabors.Primitives.Tests/PointFTests.cs | 4 +-- .../SixLabors.Primitives.Tests/PointTests.cs | 4 +-- 3 files changed, 18 insertions(+), 20 deletions(-) rename src/SixLabors.Primitives/{Matrix3x2Extentions.cs => Matrix3x2Extensions.cs} (77%) diff --git a/src/SixLabors.Primitives/Matrix3x2Extentions.cs b/src/SixLabors.Primitives/Matrix3x2Extensions.cs similarity index 77% rename from src/SixLabors.Primitives/Matrix3x2Extentions.cs rename to src/SixLabors.Primitives/Matrix3x2Extensions.cs index f20e19a1b..626be8ed7 100644 --- a/src/SixLabors.Primitives/Matrix3x2Extentions.cs +++ b/src/SixLabors.Primitives/Matrix3x2Extensions.cs @@ -1,25 +1,23 @@ -// +// // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. // namespace SixLabors.Primitives { - using System; using System.Numerics; - using System.Runtime.CompilerServices; /// - /// A Matrix object for applying matrix transforms to primitives. + /// Extension methods for the struct. /// - public static class Matrix3x2Extentions + public static class Matrix3x2Extensions { /// /// Creates a translation matrix from the given vector. /// /// The translation position. /// A translation matrix. - public static Matrix3x2 CreateTranslation(PointF position) => System.Numerics.Matrix3x2.CreateTranslation(position); + public static Matrix3x2 CreateTranslation(PointF position) => Matrix3x2.CreateTranslation(position); /// /// Creates a scale matrix that is offset by a given center point. @@ -28,14 +26,14 @@ namespace SixLabors.Primitives /// Value to scale by on the Y-axis. /// The center point. /// A scaling matrix. - public static Matrix3x2 CreateScale(float xScale, float yScale, PointF centerPoint) => System.Numerics.Matrix3x2.CreateScale(xScale, yScale, centerPoint); + public static Matrix3x2 CreateScale(float xScale, float yScale, PointF centerPoint) => Matrix3x2.CreateScale(xScale, yScale, centerPoint); /// /// Creates a scale matrix from the given vector scale. /// /// The scale to use. /// A scaling matrix. - public static Matrix3x2 CreateScale(SizeF scales) => System.Numerics.Matrix3x2.CreateScale(scales); + public static Matrix3x2 CreateScale(SizeF scales) => Matrix3x2.CreateScale(scales); /// /// Creates a scale matrix from the given vector scale with an offset from the given center point. @@ -43,7 +41,7 @@ namespace SixLabors.Primitives /// The scale to use. /// The center offset. /// A scaling matrix. - public static Matrix3x2 CreateScale(SizeF scales, PointF centerPoint) => System.Numerics.Matrix3x2.CreateScale(scales, centerPoint); + public static Matrix3x2 CreateScale(SizeF scales, PointF centerPoint) => Matrix3x2.CreateScale(scales, centerPoint); /// /// Creates a scale matrix that scales uniformly with the given scale with an offset from the given center. @@ -51,7 +49,7 @@ namespace SixLabors.Primitives /// The uniform scale to use. /// The center offset. /// A scaling matrix. - public static Matrix3x2 CreateScale(float scale, PointF centerPoint) => System.Numerics.Matrix3x2.CreateScale(scale, centerPoint); + public static Matrix3x2 CreateScale(float scale, PointF centerPoint) => Matrix3x2.CreateScale(scale, centerPoint); /// /// Creates a skew matrix from the given angles in radians. @@ -59,7 +57,7 @@ namespace SixLabors.Primitives /// The X angle, in degrees. /// The Y angle, in degrees. /// A skew matrix. - public static Matrix3x2 CreateSkewDegrees(float degreesX, float degreesY) => System.Numerics.Matrix3x2.CreateSkew(MathF.ToRadians(degreesX), MathF.ToRadians(degreesY)); + public static Matrix3x2 CreateSkewDegrees(float degreesX, float degreesY) => Matrix3x2.CreateSkew(MathF.ToRadians(degreesX), MathF.ToRadians(degreesY)); /// /// Creates a skew matrix from the given angles in radians and a center point. @@ -68,7 +66,7 @@ namespace SixLabors.Primitives /// The Y angle, in radians. /// The center point. /// A skew matrix. - public static Matrix3x2 CreateSkew(float radiansX, float radiansY, PointF centerPoint) => System.Numerics.Matrix3x2.CreateSkew(radiansX, radiansY, centerPoint); + public static Matrix3x2 CreateSkew(float radiansX, float radiansY, PointF centerPoint) => Matrix3x2.CreateSkew(radiansX, radiansY, centerPoint); /// /// Creates a skew matrix from the given angles in radians and a center point. @@ -77,14 +75,14 @@ namespace SixLabors.Primitives /// The Y angle, in degrees. /// The center point. /// A skew matrix. - public static Matrix3x2 CreateSkewDegrees(float degreesX, float degreesY, PointF centerPoint) => System.Numerics.Matrix3x2.CreateSkew(MathF.ToRadians(degreesX), MathF.ToRadians(degreesY), centerPoint); + public static Matrix3x2 CreateSkewDegrees(float degreesX, float degreesY, PointF centerPoint) => Matrix3x2.CreateSkew(MathF.ToRadians(degreesX), MathF.ToRadians(degreesY), centerPoint); /// /// Creates a rotation matrix using the given rotation in radians. /// /// The amount of rotation, in degrees. /// A rotation matrix. - public static Matrix3x2 CreateRotationDegrees(float degrees) => System.Numerics.Matrix3x2.CreateRotation(MathF.ToRadians(degrees)); + public static Matrix3x2 CreateRotationDegrees(float degrees) => Matrix3x2.CreateRotation(MathF.ToRadians(degrees)); /// /// Creates a rotation matrix using the given rotation in radians and a center point. @@ -92,7 +90,7 @@ namespace SixLabors.Primitives /// The amount of rotation, in radians. /// The center point. /// A rotation matrix. - public static Matrix3x2 CreateRotation(float radians, PointF centerPoint) => System.Numerics.Matrix3x2.CreateRotation(radians, centerPoint); + public static Matrix3x2 CreateRotation(float radians, PointF centerPoint) => Matrix3x2.CreateRotation(radians, centerPoint); /// /// Creates a rotation matrix using the given rotation in radians and a center point. @@ -100,6 +98,6 @@ namespace SixLabors.Primitives /// The amount of rotation, in degrees. /// The center point. /// A rotation matrix. - public static Matrix3x2 CreateRotationDegrees(float degrees, PointF centerPoint) => System.Numerics.Matrix3x2.CreateRotation(MathF.ToRadians(degrees), centerPoint); + public static Matrix3x2 CreateRotationDegrees(float degrees, PointF centerPoint) => Matrix3x2.CreateRotation(MathF.ToRadians(degrees), centerPoint); } } diff --git a/tests/SixLabors.Primitives.Tests/PointFTests.cs b/tests/SixLabors.Primitives.Tests/PointFTests.cs index b415e302c..7406b10cd 100644 --- a/tests/SixLabors.Primitives.Tests/PointFTests.cs +++ b/tests/SixLabors.Primitives.Tests/PointFTests.cs @@ -106,7 +106,7 @@ namespace SixLabors.Primitives.Tests public void RotateTest() { var p = new PointF(13, 17); - Matrix3x2 matrix = Matrix3x2Extentions.CreateRotationDegrees(45, PointF.Empty); + Matrix3x2 matrix = Matrix3x2Extensions.CreateRotationDegrees(45, PointF.Empty); var pout = PointF.Rotate(p, matrix); @@ -117,7 +117,7 @@ namespace SixLabors.Primitives.Tests public void SkewTest() { var p = new PointF(13, 17); - Matrix3x2 matrix = Matrix3x2Extentions.CreateSkewDegrees(45, 45, PointF.Empty); + Matrix3x2 matrix = Matrix3x2Extensions.CreateSkewDegrees(45, 45, PointF.Empty); var pout = PointF.Skew(p, matrix); Assert.Equal(new PointF(30, 30), pout); diff --git a/tests/SixLabors.Primitives.Tests/PointTests.cs b/tests/SixLabors.Primitives.Tests/PointTests.cs index c20fed339..495a34ff6 100644 --- a/tests/SixLabors.Primitives.Tests/PointTests.cs +++ b/tests/SixLabors.Primitives.Tests/PointTests.cs @@ -161,7 +161,7 @@ namespace SixLabors.Primitives.Tests public void RotateTest() { var p = new Point(13, 17); - Matrix3x2 matrix = Matrix3x2Extentions.CreateRotationDegrees(45, Point.Empty); + Matrix3x2 matrix = Matrix3x2Extensions.CreateRotationDegrees(45, Point.Empty); var pout = Point.Rotate(p, matrix); @@ -172,7 +172,7 @@ namespace SixLabors.Primitives.Tests public void SkewTest() { var p = new Point(13, 17); - Matrix3x2 matrix = Matrix3x2Extentions.CreateSkewDegrees(45, 45, Point.Empty); + Matrix3x2 matrix = Matrix3x2Extensions.CreateSkewDegrees(45, 45, Point.Empty); var pout = Point.Skew(p, matrix); Assert.Equal(new Point(30, 30), pout);