PointClosed returns true if the last subpath of p is a closed path and the close command is a point and not a line.
()
| 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. |
| 252 | func (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? |