static public bool TryGetConstrainedBy(this RectF2 item, RectF2 bounds, out RectF2 output) { output = item.GetConstrainedAboveX(bounds.GetLeft()) .GetConstrainedBelowX(bounds.GetRight()) .GetConstrainedAboveY(bounds.GetBottom()) .GetConstrainedBelowY(bounds.GetTop()); if (bounds.FullyContains(output)) { return(true); } return(false); }