Permalink
Browse files

Add Bounds.FromPositionAndSize

  • Loading branch information...
1 parent 71fe70c commit bae7ab8c4c62bfa3c13789cc3f50d9f1903fa9fa @kg kg committed Apr 6, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 Squared/GameLib/Geometry.cs
@@ -194,6 +194,12 @@ public Bounds (Rectangle rectangle, float scaleX = 1, float scaleY = 1)
result = default(Bounds);
return false;
}
+
+ public static Bounds FromPositionAndSize (Vector2 position, Vector2 size) {
+ return new Bounds(
+ position, position + size
+ );
+ }
}
public class Polygon : IEnumerable<Vector2>, IHasBounds {

0 comments on commit bae7ab8

Please sign in to comment.