CanHold() public method

Can this rectangle hold the subject rectangle
public CanHold ( Rectangle subject ) : bool
subject Rectangle The rectangle to compare to
return bool
Beispiel #1
0
 /// <summary>
 /// Resizes this rectangle to fit inside a target rectangle
 /// </summary>
 /// <param name="target">The target rectangle</param>
 /// <returns>A new rectangle that fits within the target rectangle</returns>
 public Rectangle EnsureFit(Rectangle target)
     => target.CanHold(this) ? new Rectangle(Width, Height) : Match(target);
Beispiel #2
0
 /// <summary>
 /// Resizes this rectangle to fit inside a target rectangle
 /// </summary>
 /// <param name="target">The target rectangle</param>
 /// <returns>A new rectangle that fits within the target rectangle</returns>
 public Rectangle EnsureFit(Rectangle target)
 => target.CanHold(this) ? new Rectangle(Width, Height) : Match(target);