diff --git a/Source/OpenTK/Math/Box2.cs b/Source/OpenTK/Math/Box2.cs index a3dbf254..0abfa8ce 100644 --- a/Source/OpenTK/Math/Box2.cs +++ b/Source/OpenTK/Math/Box2.cs @@ -8,10 +8,10 @@ using System; using System.Runtime.InteropServices; namespace OpenTK { - /// - /// Defines a 2d box (rectangle). - /// - [StructLayout(LayoutKind.Sequential)] + /// + /// Defines a 2d box (rectangle). + /// + [StructLayout(LayoutKind.Sequential)] public struct Box2 { /// @@ -75,62 +75,62 @@ namespace OpenTK return new Box2(left, top, right, bottom); } - /// + /// /// Creates a new Box2 with the specified dimensions. /// /// The position of the top boundary. /// The position of the left boundary. - /// The width of the box. - /// The height of the box. + /// The width of the box. + /// The height of the box. /// A new OpenTK.Box2 with the specfied dimensions. - public static Box2 FromDimensions(float left, float top, float width, float height) - { - return new Box2(left, top, left + width, top + height); - } + public static Box2 FromDimensions(float left, float top, float width, float height) + { + return new Box2(left, top, left + width, top + height); + } - /// + /// /// Creates a new Box2 with the specified dimensions. /// /// The position of the top left corner. /// The size of the box. /// A new OpenTK.Box2 with the specfied dimensions. - public static Box2 FromDimensions(Vector2 position, Vector2 size) - { - return FromDimensions(position.X, position.Y, size.X, size.Y); - } + public static Box2 FromDimensions(Vector2 position, Vector2 size) + { + return FromDimensions(position.X, position.Y, size.X, size.Y); + } - /// - /// Creates a new Box2 from the specified corners. - /// - /// One of the corners of the box. - /// The opposite corner of the box. - /// + /// + /// Creates a new Box2 from the specified corners. + /// + /// One of the corners of the box. + /// The opposite corner of the box. + /// public static Box2 FromCorners(Vector2 corner1, Vector2 corner2) { - Box2 box; - if (corner1.X < corner2.X) - { - box.Left = corner1.X; - box.Right = corner2.X; - } - else - { - box.Left = corner2.X; - box.Right = corner1.X; - } + Box2 box; + if (corner1.X < corner2.X) + { + box.Left = corner1.X; + box.Right = corner2.X; + } + else + { + box.Left = corner2.X; + box.Right = corner1.X; + } - if (corner1.Y < corner2.Y) - { - box.Top = corner1.Y; - box.Bottom = corner2.Y; - } - else - { - box.Top = corner2.Y; - box.Bottom = corner1.Y; - } + if (corner1.Y < corner2.Y) + { + box.Top = corner1.Y; + box.Bottom = corner2.Y; + } + else + { + box.Top = corner2.Y; + box.Bottom = corner1.Y; + } - return box; + return box; } /// @@ -143,67 +143,67 @@ namespace OpenTK /// public float Height { get { return (float)System.Math.Abs(Bottom - Top); } } - /// - /// Returns whether the box contains the specified point. - /// - /// The point to query. - /// Whether this box contains the point. - public bool Contains(Vector2 point) - { - return (point.X >= Left != point.X > Right) && (point.Y >= Top != point.Y > Bottom); - } + /// + /// Returns whether the box contains the specified point. + /// + /// The point to query. + /// Whether this box contains the point. + public bool Contains(Vector2 point) + { + return (point.X >= Left != point.X > Right) && (point.Y >= Top != point.Y > Bottom); + } - /// - /// Returns a Box2 translated by the given amount. - /// - /// - /// - public Box2 Translate(Vector2 point) - { - return new Box2(Left + point.X, Top + point.Y, Right + point.X, Bottom + point.Y); - } + /// + /// Returns a Box2 translated by the given amount. + /// + /// + /// + public Box2 Translate(Vector2 point) + { + return new Box2(Left + point.X, Top + point.Y, Right + point.X, Bottom + point.Y); + } - /// - /// Equality comparator. - /// - public static bool operator ==(Box2 left, Box2 right) - { - return left.Bottom == right.Bottom && left.Top == right.Top && - left.Left == right.Left && left.Right == right.Right; - } + /// + /// Equality comparator. + /// + public static bool operator ==(Box2 left, Box2 right) + { + return left.Bottom == right.Bottom && left.Top == right.Top && + left.Left == right.Left && left.Right == right.Right; + } - /// - /// Inequality comparator. - /// - public static bool operator !=(Box2 left, Box2 right) - { - return !(left == right); - } + /// + /// Inequality comparator. + /// + public static bool operator !=(Box2 left, Box2 right) + { + return !(left == right); + } - /// - /// Functional equality comparator. - /// - public bool Equals(Box2 other) - { - return this == other; - } + /// + /// Functional equality comparator. + /// + public bool Equals(Box2 other) + { + return this == other; + } - /// - /// Implements Object.Equals. - /// - public override bool Equals(object obj) - { - return obj is Box2 && Equals((Box2) obj); - } + /// + /// Implements Object.Equals. + /// + public override bool Equals(object obj) + { + return obj is Box2 && Equals((Box2) obj); + } - /// - /// Gets the hash code for this Box2. - /// - /// - public override int GetHashCode() - { - return Left.GetHashCode() ^ Right.GetHashCode() ^ Top.GetHashCode() ^ Bottom.GetHashCode(); - } + /// + /// Gets the hash code for this Box2. + /// + /// + public override int GetHashCode() + { + return Left.GetHashCode() ^ Right.GetHashCode() ^ Top.GetHashCode() ^ Bottom.GetHashCode(); + } private static string listSeparator = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ListSeparator; /// diff --git a/Source/OpenTK/Math/Box2d.cs b/Source/OpenTK/Math/Box2d.cs index eae7f46e..6ae120fe 100644 --- a/Source/OpenTK/Math/Box2d.cs +++ b/Source/OpenTK/Math/Box2d.cs @@ -8,10 +8,10 @@ using System; using System.Runtime.InteropServices; namespace OpenTK { - /// - /// Defines a 2d box (rectangle). - /// - [StructLayout(LayoutKind.Sequential)] + /// + /// Defines a 2d box (rectangle). + /// + [StructLayout(LayoutKind.Sequential)] public struct Box2d { /// @@ -75,62 +75,62 @@ namespace OpenTK return new Box2d(left, top, right, bottom); } - /// + /// /// Creates a new Box2d with the specified dimensions. /// /// The position of the top boundary. /// The position of the left boundary. - /// The width of the box. - /// The height of the box. + /// The width of the box. + /// The height of the box. /// A new OpenTK.Box2d with the specfied dimensions. - public static Box2d FromDimensions(double left, double top, double width, double height) - { - return new Box2d(left, top, left + width, top + height); - } + public static Box2d FromDimensions(double left, double top, double width, double height) + { + return new Box2d(left, top, left + width, top + height); + } - /// + /// /// Creates a new Box2d with the specified dimensions. /// /// The position of the top left corner. /// The size of the box. /// A new OpenTK.Box2d with the specfied dimensions. - public static Box2d FromDimensions(Vector2d position, Vector2d size) - { - return FromDimensions(position.X, position.Y, size.X, size.Y); - } + public static Box2d FromDimensions(Vector2d position, Vector2d size) + { + return FromDimensions(position.X, position.Y, size.X, size.Y); + } - /// - /// Creates a new Box2d from the specified corners. - /// - /// One of the corners of the box. - /// The opposite corner of the box. - /// + /// + /// Creates a new Box2d from the specified corners. + /// + /// One of the corners of the box. + /// The opposite corner of the box. + /// public static Box2d FromCorners(Vector2d corner1, Vector2d corner2) { - Box2d box; - if (corner1.X < corner2.X) - { - box.Left = corner1.X; - box.Right = corner2.X; - } - else - { - box.Left = corner2.X; - box.Right = corner1.X; - } + Box2d box; + if (corner1.X < corner2.X) + { + box.Left = corner1.X; + box.Right = corner2.X; + } + else + { + box.Left = corner2.X; + box.Right = corner1.X; + } - if (corner1.Y < corner2.Y) - { - box.Top = corner1.Y; - box.Bottom = corner2.Y; - } - else - { - box.Top = corner2.Y; - box.Bottom = corner1.Y; - } + if (corner1.Y < corner2.Y) + { + box.Top = corner1.Y; + box.Bottom = corner2.Y; + } + else + { + box.Top = corner2.Y; + box.Bottom = corner1.Y; + } - return box; + return box; } /// @@ -143,67 +143,67 @@ namespace OpenTK /// public double Height { get { return (double)System.Math.Abs(Bottom - Top); } } - /// - /// Returns whether the box contains the specified point. - /// - /// The point to query. - /// Whether this box contains the point. - public bool Contains(Vector2d point) - { - return (point.X >= Left != point.X > Right) && (point.Y >= Top != point.Y > Bottom); - } + /// + /// Returns whether the box contains the specified point. + /// + /// The point to query. + /// Whether this box contains the point. + public bool Contains(Vector2d point) + { + return (point.X >= Left != point.X > Right) && (point.Y >= Top != point.Y > Bottom); + } - /// - /// Returns a Box2d translated by the given amount. - /// - /// - /// - public Box2d Translate(Vector2d point) - { - return new Box2d(Left + point.X, Top + point.Y, Right + point.X, Bottom + point.Y); - } + /// + /// Returns a Box2d translated by the given amount. + /// + /// + /// + public Box2d Translate(Vector2d point) + { + return new Box2d(Left + point.X, Top + point.Y, Right + point.X, Bottom + point.Y); + } - /// - /// Equality comparator. - /// - public static bool operator ==(Box2d left, Box2d right) - { - return left.Bottom == right.Bottom && left.Top == right.Top && - left.Left == right.Left && left.Right == right.Right; - } + /// + /// Equality comparator. + /// + public static bool operator ==(Box2d left, Box2d right) + { + return left.Bottom == right.Bottom && left.Top == right.Top && + left.Left == right.Left && left.Right == right.Right; + } - /// - /// Inequality comparator. - /// - public static bool operator !=(Box2d left, Box2d right) - { - return !(left == right); - } + /// + /// Inequality comparator. + /// + public static bool operator !=(Box2d left, Box2d right) + { + return !(left == right); + } - /// - /// Functional equality comparator. - /// - public bool Equals(Box2d other) - { - return this == other; - } + /// + /// Functional equality comparator. + /// + public bool Equals(Box2d other) + { + return this == other; + } - /// - /// Implements Object.Equals. - /// - public override bool Equals(object obj) - { - return obj is Box2d && Equals((Box2d) obj); - } + /// + /// Implements Object.Equals. + /// + public override bool Equals(object obj) + { + return obj is Box2d && Equals((Box2d) obj); + } - /// - /// Gets the hash code for this Box2d. - /// - /// - public override int GetHashCode() - { - return Left.GetHashCode() ^ Right.GetHashCode() ^ Top.GetHashCode() ^ Bottom.GetHashCode(); - } + /// + /// Gets the hash code for this Box2d. + /// + /// + public override int GetHashCode() + { + return Left.GetHashCode() ^ Right.GetHashCode() ^ Top.GetHashCode() ^ Bottom.GetHashCode(); + } private static string listSeparator = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ListSeparator; ///