MCPcopy Create free account
hub / github.com/tdewolff/canvas / Center

Method Center

util.go:419–421  ·  view source on GitHub ↗

Center returns the center point.

()

Source from the content-addressed store, hash-verified

417
418// Center returns the center point.
419func (r Rect) Center() Point {
420 return Point{(r.X0 + r.X1) / 2.0, (r.Y0 + r.Y1) / 2.0}
421}
422
423// Equals returns true if rectangles are equal with tolerance Epsilon.
424func (r Rect) Equals(q Rect) bool {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected