Changeset 4753 for 2013/30/DenisZ/CastleMaster/CastleMaster/CastleMaster/MathHelpers/FastFunctions.cs
 Timestamp:
 20130901 18:40:38 (6 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

2013/30/DenisZ/CastleMaster/CastleMaster/CastleMaster/MathHelpers/FastFunctions.cs
r4535 r4753 1 1 2 using Microsoft.Xna.Framework; 3 using System; 2 4 namespace CastleMaster.MathHelpers 3 5 { … … 12 14 return ag  r  b; 13 15 } 16 17 public static Rectangle RectangleFromPoints(Point p0, Point p1) 18 { 19 int width = Math.Abs(p1.X  p0.X); 20 int height = Math.Abs(p1.Y  p0.Y); 21 22 int x = p0.X; 23 int y = p0.Y; 24 25 if (p1.X < p0.X) 26 x = p1.X; 27 if (p1.Y < p0.Y) 28 y = p1.Y; 29 30 return new Rectangle(x, y, width, height); 31 } 14 32 } 15 33 }
Note: See TracChangeset
for help on using the changeset viewer.