MCPcopy Create free account
hub / github.com/5zig/The-5zig-Mod / intersects

Method intersects

Mod Utils/src/eu/the5zig/mod/util/Rectangle.java:105–123  ·  view source on GitHub ↗
(Rectangle r)

Source from the content-addressed store, hash-verified

103 }
104
105 public boolean intersects(Rectangle r) {
106 int tw = this.width;
107 int th = this.height;
108 int rw = r.getWidth();
109 int rh = r.getHeight();
110 if (rw > 0 && rh > 0 && tw > 0 && th > 0) {
111 int tx = this.x;
112 int ty = this.y;
113 int rx = r.getX();
114 int ry = r.getY();
115 rw += rx;
116 rh += ry;
117 tw += tx;
118 th += ty;
119 return (rw < rx || rw > tx) && (rh < ry || rh > ty) && (tw < tx || tw > rx) && (th < ty || th > ry);
120 } else {
121 return false;
122 }
123 }
124
125 public Rectangle intersection(Rectangle r, Rectangle dest) {
126 int tx1 = this.x;

Callers

nothing calls this directly

Calls 4

getWidthMethod · 0.65
getHeightMethod · 0.65
getXMethod · 0.65
getYMethod · 0.65

Tested by

no test coverage detected