public bool Contiene(Rettangolo r) { if (x <= r.x && y <= r.y && x + width >= r.x + r.width && y + height >= r.y + r.height) { return(true); } return(false); }
public bool Contiene(Rettangolo r) { if (r.x >= this.x && r.width + r.x <= width + x) { if (r.y >= this.y && r.height + r.y <= height + y) { return(true); } return(false); } else { return(false); } }