MCPcopy Index your code
hub / github.com/tdewolff/canvas / ContainsPoint

Method ContainsPoint

util.go:478–480  ·  view source on GitHub ↗

ContainsPoint returns true if the rectangle contains or touches an edge.

(p Point)

Source from the content-addressed store, hash-verified

476
477// ContainsPoint returns true if the rectangle contains or touches an edge.
478func (r Rect) ContainsPoint(p Point) bool {
479 return cohenSutherlandOutcode(r, p, 0.0) == 0
480}
481
482// TouchesPoint returns true if the rectangle touches a point (within +-Epsilon).
483func (r Rect) TouchesPoint(p Point) bool {

Callers 2

TestRectFunction · 0.95
ContainsLineMethod · 0.95

Calls 1

cohenSutherlandOutcodeFunction · 0.85

Tested by 1

TestRectFunction · 0.76