(svg, x, y, width, height)
| 62 | } |
| 63 | |
| 64 | ellipse(svg, x, y, width, height) { |
| 65 | width = Math.max(width > 10 ? width - 4 : width - 1, 1); |
| 66 | height = Math.max(height > 10 ? height - 4 : height - 1, 1); |
| 67 | const ellipseInc = (Math.PI * 2) / __curveStepCount; |
| 68 | let rx = Math.abs(width / 2); |
| 69 | let ry = Math.abs(height / 2); |
| 70 | rx += this._getOffset(-rx * 0.05, rx * 0.05); |
| 71 | ry += this._getOffset(-ry * 0.05, ry * 0.05); |
| 72 | let path = this._ellipse(ellipseInc, x, y, rx, ry, 1, ellipseInc * this._getOffset(0.1, this._getOffset(0.4, 1))); |
| 73 | path = this._ellipse(ellipseInc, x, y, rx, ry, 1.5, 0, path); |
| 74 | const node = this._svgNode("path", { d: path.value }) |
| 75 | svg.appendChild(node); |
| 76 | return node; |
| 77 | } |
| 78 | |
| 79 | _ellipse(ellipseInc, cx, cy, rx, ry, offset, overlap, existingPath) { |
| 80 | const radOffset = this._getOffset(-0.5, 0.5) - Math.PI / 2; |
no test coverage detected