internal static void Resize() { BackbufferSize = new Point2(Window.Size.X, Window.Size.Y); Viewport = new Viewport(0, 0, Window.Size.X, Window.Size.Y); ScissorRectangle = new Rectangle(0, 0, Window.Size.X, Window.Size.Y); }
/// <summary> /// Computes the distance from this <see cref="RectangleF"/> to a <see cref="Point2"/>. /// </summary> /// <param name="point">The point.</param> /// <returns>The distance from this <see cref="RectangleF"/> to the <paramref name="point"/>.</returns> public float DistanceTo(Point2 point) { return((float)Math.Sqrt(SquaredDistanceTo(point))); }
/// <summary> /// Computes the squared distance from this <see cref="RectangleF"/> to a <see cref="Point2"/>. /// </summary> /// <param name="point">The point.</param> /// <returns>The squared distance from this <see cref="RectangleF"/> to the <paramref name="point"/>.</returns> public float SquaredDistanceTo(Point2 point) { return(PrimitivesHelper.SquaredDistanceToPointFromRectangle(TopLeft, BottomRight, point)); }
/// <summary> /// Determines whether this <see cref="RectangleF" /> contains the specified /// <see cref="Point2" />. /// </summary> /// <param name="point">The point.</param> /// <returns> /// <c>true</c> if the this <see cref="RectangleF"/> contains the <paramref name="point" />; otherwise, /// <c>false</c>. /// </returns> public bool Contains(Point2 point) { return(Contains(ref this, ref point)); }
/// <summary> /// Determines whether the specified <see cref="RectangleF" /> contains the specified /// <see cref="Point2" />. /// </summary> /// <param name="rectangle">The rectangle.</param> /// <param name="point">The point.</param> /// <returns> /// <c>true</c> if the <paramref name="rectangle" /> contains the <paramref name="point" />; otherwise, /// <c>false</c>. /// </returns> public static bool Contains(RectangleF rectangle, Point2 point) { return(Contains(ref rectangle, ref point)); }
/// <summary> /// Determines whether the specified <see cref="RectangleF" /> contains the specified /// <see cref="Point2" />. /// </summary> /// <param name="rectangle">The rectangle.</param> /// <param name="point">The point.</param> /// <returns> /// <c>true</c> if the <paramref name="rectangle" /> contains the <paramref name="point" />; otherwise, /// <c>false</c>. /// </returns> public static bool Contains(ref RectangleF rectangle, ref Point2 point) { return(rectangle.X <= point.X && point.X < rectangle.X + rectangle.Width && rectangle.Y <= point.Y && point.Y < rectangle.Y + rectangle.Height); }