MCPcopy
hub / github.com/tdewolff/canvas / PointClosed

Method PointClosed

path.go:252–254  ·  view source on GitHub ↗

PointClosed returns true if the last subpath of p is a closed path and the close command is a point and not a line.

()

Source from the content-addressed store, hash-verified

250
251// PointClosed returns true if the last subpath of p is a closed path and the close command is a point and not a line.
252func (p *Path) PointClosed() bool {
253 return 6 < len(p.d) && p.d[len(p.d)-1] == CloseCmd && Equal(p.d[len(p.d)-7], p.d[len(p.d)-3]) && Equal(p.d[len(p.d)-6], p.d[len(p.d)-2])
254}
255
256// HasSubpaths returns true when path p has subpaths.
257// TODO: naming right? A simple path would not self-intersect. Add IsXMonotone and IsFlat as well?

Callers

nothing calls this directly

Calls 1

EqualFunction · 0.85

Tested by

no test coverage detected