Lines Matching refs:rectA

534      * <code>rectA</code> that do not overlap with <code>rectB</code>. If the
537 public static Rectangle[] computeDifference(Rectangle rectA,Rectangle rectB) {
538 if (rectB == null || !rectA.intersects(rectB) || isRectangleContainingRectangle(rectB,rectA)) {
547 /* rectA contains rectB */
548 if (isRectangleContainingRectangle(rectA,rectB)) {
549 t.x = rectA.x; t.y = rectA.y; t.width = rectB.x - rectA.x; t.height = rectA.height;
555 t.x = rectB.x; t.y = rectA.y; t.width = rectB.width; t.height = rectB.y - rectA.y;
562 t.height = rectA.y + rectA.height - (rectB.y + rectB.height);
568 t.x = rectB.x + rectB.width; t.y = rectA.y; t.width = rectA.x + rectA.width - (rectB.x + rectB.width);
569 t.height = rectA.height;
576 if (rectB.x <= rectA.x && rectB.y <= rectA.y) {
577 if ((rectB.x + rectB.width) > (rectA.x + rectA.width)) {
579 t.x = rectA.x; t.y = rectB.y + rectB.height;
580 t.width = rectA.width; t.height = rectA.y + rectA.height - (rectB.y + rectB.height);
585 } else if ((rectB.y + rectB.height) > (rectA.y + rectA.height)) {
586 t.setBounds((rectB.x + rectB.width), rectA.y,
587 (rectA.x + rectA.width) - (rectB.x + rectB.width), rectA.height);
593 t.setBounds((rectB.x + rectB.width), rectA.y,
594 (rectA.x + rectA.width) - (rectB.x + rectB.width),
595 (rectB.y + rectB.height) - rectA.y);
601 t.setBounds(rectA.x, (rectB.y + rectB.height), rectA.width,
602 (rectA.y + rectA.height) - (rectB.y + rectB.height));
608 } else if (rectB.x <= rectA.x && (rectB.y + rectB.height) >= (rectA.y + rectA.height)) {
609 if ((rectB.x + rectB.width) > (rectA.x + rectA.width)) {
610 t.setBounds(rectA.x, rectA.y, rectA.width, rectB.y - rectA.y);
616 t.setBounds(rectA.x, rectA.y, rectA.width, rectB.y - rectA.y);
622 (rectA.x + rectA.width) - (rectB.x + rectB.width),
623 (rectA.y + rectA.height) - rectB.y);
629 } else if (rectB.x <= rectA.x) {
630 if ((rectB.x + rectB.width) >= (rectA.x + rectA.width)) {
631 t.setBounds(rectA.x, rectA.y, rectA.width, rectB.y - rectA.y);
637 t.setBounds(rectA.x, (rectB.y + rectB.height), rectA.width,
638 (rectA.y + rectA.height) - (rectB.y + rectB.height));
644 t.setBounds(rectA.x, rectA.y, rectA.width, rectB.y - rectA.y);
651 (rectA.x + rectA.width) - (rectB.x + rectB.width),
658 t.setBounds(rectA.x, (rectB.y + rectB.height), rectA.width,
659 (rectA.y + rectA.height) - (rectB.y + rectB.height));
665 } else if (rectB.x <= (rectA.x + rectA.width) && (rectB.x + rectB.width) > (rectA.x + rectA.width)) {
666 if (rectB.y <= rectA.y && (rectB.y + rectB.height) > (rectA.y + rectA.height)) {
667 t.setBounds(rectA.x, rectA.y, rectB.x - rectA.x, rectA.height);
672 } else if (rectB.y <= rectA.y) {
673 t.setBounds(rectA.x, rectA.y, rectB.x - rectA.x,
674 (rectB.y + rectB.height) - rectA.y);
680 t.setBounds(rectA.x, (rectB.y + rectB.height), rectA.width,
681 (rectA.y + rectA.height) - (rectB.y + rectB.height));
686 } else if ((rectB.y + rectB.height) > (rectA.y + rectA.height)) {
687 t.setBounds(rectA.x, rectA.y, rectA.width, rectB.y - rectA.y);
693 t.setBounds(rectA.x, rectB.y, rectB.x - rectA.x,
694 (rectA.y + rectA.height) - rectB.y);
700 t.setBounds(rectA.x, rectA.y, rectA.width, rectB.y - rectA.y);
706 t.setBounds(rectA.x, rectB.y, rectB.x - rectA.x,
713 t.setBounds(rectA.x, (rectB.y + rectB.height), rectA.width,
714 (rectA.y + rectA.height) - (rectB.y + rectB.height));
720 } else if (rectB.x >= rectA.x && (rectB.x + rectB.width) <= (rectA.x + rectA.width)) {
721 if (rectB.y <= rectA.y && (rectB.y + rectB.height) > (rectA.y + rectA.height)) {
722 t.setBounds(rectA.x, rectA.y, rectB.x - rectA.x, rectA.height);
727 t.setBounds((rectB.x + rectB.width), rectA.y,
728 (rectA.x + rectA.width) - (rectB.x + rectB.width), rectA.height);
733 } else if (rectB.y <= rectA.y) {
734 t.setBounds(rectA.x, rectA.y, rectB.x - rectA.x, rectA.height);
742 (rectA.y + rectA.height) - (rectB.y + rectB.height));
748 t.setBounds((rectB.x + rectB.width), rectA.y,
749 (rectA.x + rectA.width) - (rectB.x + rectB.width), rectA.height);
755 t.setBounds(rectA.x, rectA.y, rectB.x - rectA.x, rectA.height);
761 t.setBounds(rectB.x, rectA.y, rectB.width,
762 rectB.y - rectA.y);
768 t.setBounds((rectB.x + rectB.width), rectA.y,
769 (rectA.x + rectA.width) - (rectB.x + rectB.width), rectA.height);