public static IntRect Round(this FloatRect rect) { var top = (int)Math.Round(rect.Top); var left = (int)Math.Round(rect.Left); var right = (int)Math.Round(rect.Right()); var bottom = (int)Math.Round(rect.Bottom()); return new IntRect(left, top, right - left, bottom - top); }
public static FluentLayout WithSameBottom(this UIView view, UIView previous) { return view.Bottom().EqualTo().BottomOf(previous); }
public static FluentLayout Above(this UIView view, UIView previous, float margin = 0f) { return view.Bottom().EqualTo().TopOf(previous).Plus(margin); }
public static FluentLayout AtBottomOf(this UIView view, UIView parentView, float margin = 0f) { return view.Bottom().EqualTo().BottomOf(parentView).Minus(margin); }
public static IEnumerable<FluentLayout> FullHeightOf(this UIView view, UIView parent, float margin = 0f) { yield return view.Top().EqualTo().TopOf(parent).Plus(margin); yield return view.Bottom().EqualTo().BottomOf(parent).Minus(margin); }
public static FluentLayout Above(this UIView view, UIView previous, nfloat? margin = null) { return view.Bottom().EqualTo().TopOf(previous).Minus(margin.GetValueOrDefault(DefaultMargin)); }
public static FluentLayout AtBottomOf(this UIView view, UIView parentView, nfloat? margin = null) { return view.Bottom().EqualTo().BottomOf(parentView).Minus(margin.GetValueOrDefault(DefaultMargin)); }
public static IEnumerable<FluentLayout> FullHeightOf(this UIView view, UIView parent, nfloat? margin = null) { var marginValue = margin.GetValueOrDefault(DefaultMargin); yield return view.Top().EqualTo().TopOf(parent).Plus(marginValue); yield return view.Bottom().EqualTo().BottomOf(parent).Minus(marginValue); }
public static bool Encloses(this FloatRect outer, FloatRect inner) => (outer.Left <= inner.Left) && (inner.Right() <= outer.Right()) && (outer.Top <= inner.Top) && (inner.Bottom() <= outer.Bottom());