diff --git a/AssemblyInfo.cs b/AssemblyInfo.cs index 75ea85f..b21fc4e 100644 --- a/AssemblyInfo.cs +++ b/AssemblyInfo.cs @@ -1,7 +1,7 @@ -using System.Reflection; +using System.Reflection; using System.Runtime.InteropServices; -[assembly: AssemblyVersion("1.2.*")] +[assembly: AssemblyVersion("1.3.*")] [assembly: AssemblyCompany("Lost Tech LLC")] [assembly: AssemblyProduct("Stack")] [assembly: AssemblyCopyright("Copyright © Lost Tech LLC 2020")] diff --git a/Utils/DrawingPointUtils.cs b/Utils/DrawingPointUtils.cs deleted file mode 100644 index 9f77eea..0000000 --- a/Utils/DrawingPointUtils.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace LostTech.Stack.Utils { - using System; - using System.Drawing; - public static class DrawingPointUtils { - public static PointF Diff(this PointF self, PointF other) => new PointF(self.X - other.X, self.Y - other.Y); - public static float LengthSquared(this PointF self) => self.X * self.X + self.Y * self.Y; - public static float Length(this PointF self) => (float)Math.Sqrt(self.LengthSquared()); - - public static bool Equals(this PointF value, PointF other, double epsilon) => - value.Diff(other).LengthSquared() < epsilon * epsilon; - public static PointF Scale(this PointF self, float scale) => - new PointF(scale * self.X, scale * self.Y); - } -} diff --git a/Utils/RectExtensions.cs b/Utils/RectExtensions.cs deleted file mode 100644 index d160899..0000000 --- a/Utils/RectExtensions.cs +++ /dev/null @@ -1,36 +0,0 @@ -namespace LostTech.Stack.Utils { - using System.Drawing; - using Rect = System.Drawing.RectangleF; - - public static class RectExtensions { - public static PointF Center(this Rect rect) => - new PointF(0.5f * (rect.Left + rect.Right), 0.5f * (rect.Top + rect.Bottom)); - - public static Rect Intersection(this Rect rect, Rect otherRect) { - rect.Intersect(otherRect); - return rect; - } - - public static double Area(this Rect rect) => rect.Width * rect.Height; - - public static double DotProduct(this PointF value, PointF other) => value.X * other.X + value.Y * other.Y; - - public static Rect Inflated(this Rect rect, float x, float y) { - if (x < 0 && rect.Width < x) - return rect; - if (y < 0 && rect.Height < y) - return rect; - rect.Inflate(x, y); - return rect; - } - - public static bool IsHorizontal(this Rect rect) => rect.Width > rect.Height; - public static PointF TopLeft(this Rect rect) => rect.Location; - public static PointF TopRight(this Rect rect) => new PointF(rect.Right, rect.Top); - public static PointF BottomRight(this Rect rect) => new PointF(rect.Right, rect.Bottom); - public static PointF BottomLeft(this Rect rect) => new PointF(rect.Left, rect.Bottom); - - public static PointF[] Corners(this Rect rect) => - new[] { rect.TopLeft(), rect.TopRight(), rect.BottomRight(), rect.BottomLeft() }; - } -}