| 8053 | return buffer && buffer.value(); |
| 8054 | } |
| 8055 | renderHull(context) { |
| 8056 | const buffer = context == null ? context = new Path : undefined; |
| 8057 | const {hull, points} = this; |
| 8058 | const h = hull[0] * 2, n = hull.length; |
| 8059 | context.moveTo(points[h], points[h + 1]); |
| 8060 | for (let i = 1; i < n; ++i) { |
| 8061 | const h = 2 * hull[i]; |
| 8062 | context.lineTo(points[h], points[h + 1]); |
| 8063 | } |
| 8064 | context.closePath(); |
| 8065 | return buffer && buffer.value(); |
| 8066 | } |
| 8067 | hullPolygon() { |
| 8068 | const polygon = new Polygon; |
| 8069 | this.renderHull(polygon); |