(ctx: CanvasRenderingContext2D, opts: RenderTextOpts)
| 383 | } |
| 384 | |
| 385 | function setRenderOpts(ctx: CanvasRenderingContext2D, opts: RenderTextOpts) { |
| 386 | if (opts.translation) { |
| 387 | ctx.translate(opts.translation[0], opts.translation[1]); |
| 388 | } |
| 389 | |
| 390 | if (!isNullOrUndef(opts.rotation)) { |
| 391 | ctx.rotate(opts.rotation); |
| 392 | } |
| 393 | |
| 394 | if (opts.color) { |
| 395 | ctx.fillStyle = opts.color; |
| 396 | } |
| 397 | |
| 398 | if (opts.textAlign) { |
| 399 | ctx.textAlign = opts.textAlign; |
| 400 | } |
| 401 | |
| 402 | if (opts.textBaseline) { |
| 403 | ctx.textBaseline = opts.textBaseline; |
| 404 | } |
| 405 | } |
| 406 | |
| 407 | function decorateText( |
| 408 | ctx: CanvasRenderingContext2D, |
no test coverage detected