MCPcopy Create free account
hub / github.com/TigerVNC/tigervnc / intersect

Method intersect

java/com/tigervnc/rfb/Rect.java:50–57  ·  view source on GitHub ↗
(Rect r)

Source from the content-addressed store, hash-verified

48 tl.x = x; tl.y = y; br.x = x+w; br.y = y+h;
49 }
50 public final Rect intersect(Rect r) {
51 Rect result = new Rect();
52 result.tl.x = Math.max(tl.x, r.tl.x);
53 result.tl.y = Math.max(tl.y, r.tl.y);
54 result.br.x = Math.max(Math.min(br.x, r.br.x), result.tl.x);
55 result.br.y = Math.max(Math.min(br.y, r.br.y), result.tl.y);
56 return result;
57 }
58 public final Rect union_boundary(Rect r) {
59 if (r.is_empty()) return this;
60 if (is_empty()) return r;

Callers 2

copyRectMethod · 0.95
maskRectMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected