public static Rectangle <T> FromPositionSize <T>(T left, T top, T width, T height) { return(FromIntervals( Interval.FromOffsetLength(left, width), Interval.FromOffsetLength(top, height))); }
public static Rectangle <T> ToRectangle <T>(this Size <T> size) where T : INumeric <T>, new() { return(FromIntervals( Interval.FromOffsetLength(new T(), size.Width), Interval.FromOffsetLength(new T(), size.Height))); }
public static Rectangle <double> FromSides(double left, double top, double right, double bottom) { return(FromIntervals( Interval.FromMinMax(left, right), Interval.FromMinMax(top, bottom))); }
// Constructors public static Rectangle <T> FromIntervals <T>(Interval <T> horizontalInterval, Interval <T> verticalInterval) { return(new Rectangle <T>(horizontalInterval, verticalInterval)); }
public static Rectangle <T> WithAxis <T>(this Rectangle <T> rect, Axis2D axis, Interval <T> interval) { return(axis == Axis2D.Horizontal ? new Rectangle <T>(interval, rect.VerticalInterval) : new Rectangle <T>(rect.HorizontalInterval, interval)); }
public static Rectangle <IObservable <T> > MoveTo <T>(this Rectangle <IObservable <T> > rect, Point <IObservable <T> > position) where T : INumeric <T> { return(FromIntervals( Interval.FromOffsetLength(rect.HorizontalInterval.Offset.Add(position.X), rect.Width), Interval.FromOffsetLength(rect.VerticalInterval.Offset.Add(position.Y), rect.Height))); }