Java Rectangle Contain contains(Rectangle c, Rectangle a)

Here you can find the source of contains(Rectangle c, Rectangle a)

Description

contains

License

Open Source License

Declaration

public static boolean contains(Rectangle c, Rectangle a) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.awt.*;

public class Main {
    public static boolean contains(Rectangle c, Rectangle a) {
        return c.x <= a.x + a.width && c.x + c.width > a.x && c.y <= a.y + a.height && c.y + c.height > a.y;
    }//from   ww w  .j av  a 2  s  .  c  o m
}

Related

  1. contains(Rectangle rect1, Rectangle rect2)
  2. stretchToFit(Rectangle container, Rectangle item)