()
| 1192 | } |
| 1193 | |
| 1194 | function pop() { |
| 1195 | /* Pops the transformation state. |
| 1196 | * This reverts the transformation to before the last push(). |
| 1197 | */ |
| 1198 | _ctx.restore(); |
| 1199 | // Do not reset the color state: |
| 1200 | if (_ctx.state._fill) { |
| 1201 | _ctx.fillStyle = _ctx.state._fill; |
| 1202 | } |
| 1203 | if (_ctx.state._stroke) { |
| 1204 | _ctx.strokeStyle = _ctx.state._stroke; |
| 1205 | } |
| 1206 | } |
| 1207 | |
| 1208 | function translate(x, y) { |
| 1209 | /* By default, the origin of the layer or canvas is at the bottom left. |