Ignore:
Timestamp:
2013-09-01 18:40:38 (6 years ago)
Author:
dezhidki
Message:
  • Lisätty kunnon ohjeet.
  • Ctrl + RMouse toimii nyt kunnolla (voi valita monta kerrallaan).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2013/30/DenisZ/CastleMaster/CastleMaster/CastleMaster/MathHelpers/FastFunctions.cs

    r4535 r4753  
    11 
     2using Microsoft.Xna.Framework; 
     3using System; 
    24namespace CastleMaster.MathHelpers 
    35{ 
     
    1214            return ag | r | b; 
    1315        } 
     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        } 
    1432    } 
    1533} 
Note: See TracChangeset for help on using the changeset viewer.