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;
true if the first rectangle completely contains the second one.
return (rect2.x >= rect1.x) && (rect2.y >= rect1.y) && (rect2.x + rect2.width <= rect1.x + rect1.width)
&& (rect2.y + rect2.height <= rect1.y + rect1.height);
double scale = scaleProportional(container, item); if (scale < 1) { return item; } else { return new Rectangle((int) (item.width * scale), (int) (item.height * scale));