Beispiel #1
0
 /// <summary>
 /// Gets center of the specified rectangle.
 /// </summary>
 /// <param name="rect">Rectangle.</param>
 /// <returns>Center of the rectangle.</returns>
 public static Point Center(this Rect rect)
 {
     return new Point(rect.CenterX(), rect.CenterY());
 }
Beispiel #2
0
 //Birbilis
 /// <summary>
 /// Gets scaled rect.
 /// </summary>
 /// <param name="size">Rect.</param>
 /// <returns>Scaled rect.</returns>
 public static Rect Scaled(this Rect rect, double factor)
 {
     double newWidth = rect.Width * factor;
       double newHeight = rect.Height * factor;
       return new Rect(rect.CenterX() - newWidth/2, rect.CenterY() - newHeight/2, newWidth, newHeight);
 }
 public static FluentLayout WithSameCenterY(this UIView view, UIView previous)
 {
     return view.CenterY().EqualTo().CenterYOf(previous);
 }