I have two rectangles InnerRectangle and OuterRectangle. I want to verify if four corners of InnerRectangle i.e, Lett, Top, Right, Bottom are completely inside of OuterRectangle. If those are outside I want change the ones that are outside. If I change Left/Top/Right/Bottom, how much should I change the width or height? Please let me know how to implement this.
if (InnerRectangle.Left < OuterRectangle.Left)
{
// what should I put here
}
if (InnerRectangle.Top < OuterRectangle.Top)
{
// what should I put here
}
if (InnerRectangle.Right < OuterRectangle.Right)
{
// what should I put here
}
if (InnerRectangle.Bottom < OuterRectangle.Bottom)
{
// what should I put here
}
Appreciate your help..