(ctx: CanvasRenderingContext2D, shape: BoxPathShape)
| 155 | } |
| 156 | |
| 157 | buildPath(ctx: CanvasRenderingContext2D, shape: BoxPathShape) { |
| 158 | const ends = shape.points; |
| 159 | |
| 160 | let i = 0; |
| 161 | ctx.moveTo(ends[i][0], ends[i][1]); |
| 162 | i++; |
| 163 | for (; i < 4; i++) { |
| 164 | ctx.lineTo(ends[i][0], ends[i][1]); |
| 165 | } |
| 166 | ctx.closePath(); |
| 167 | |
| 168 | for (; i < ends.length; i++) { |
| 169 | ctx.moveTo(ends[i][0], ends[i][1]); |
| 170 | i++; |
| 171 | ctx.lineTo(ends[i][0], ends[i][1]); |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | } |
| 176 |