MCPcopy Create free account
hub / github.com/SolarLune/masterplan / InsideShape

Method InsideShape

utils.go:113–120  ·  view source on GitHub ↗

func (point Point) InsideShape(shape *Shape) bool { for _, rect := range shape.Rects { if point.Inside(rect) { return true } } return false }

(shape *Shape)

Source from the content-addressed store, hash-verified

111// }
112
113func (point Vector) InsideShape(shape *Shape) int {
114 for index, rect := range shape.Rects {
115 if point.Inside(rect) {
116 return index
117 }
118 }
119 return -1
120}
121
122func (point Vector) Sub(other Vector) Vector {
123 return Vector{point.X - other.X, point.Y - other.Y}

Callers 2

UpdateMethod · 0.80
UpdateMethod · 0.80

Calls 1

InsideMethod · 0.95

Tested by

no test coverage detected