Exemple #1
0
        public bool NearlyEquals(PixelVector other)
        {
            const float tolerance = float.Epsilon;

            return(Math.Abs(_x - other._x) < tolerance && Math.Abs(_y - other._y) < tolerance);
        }
Exemple #2
0
 /// <summary>
 /// Translates the rectangle by an offset.
 /// </summary>
 /// <param name="offset">The offset.</param>
 /// <returns>The translated rectangle.</returns>
 public PixelRect Translate(PixelVector offset)
 {
     return(new PixelRect(Position + offset, Size));
 }
Exemple #3
0
 /// <summary>
 /// Check if two vectors are equal (bitwise).
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public bool Equals(PixelVector other)
 {
     return(_x == other._x && _y == other._y);
 }