(
context: CanvasRenderingContext2D,
)
| 483 | } |
| 484 | |
| 485 | protected override async draw( |
| 486 | context: CanvasRenderingContext2D, |
| 487 | ): Promise<void> { |
| 488 | this.requestFontUpdate(); |
| 489 | this.applyStyle(context); |
| 490 | this.applyText(context); |
| 491 | const size = this.computedSize(); |
| 492 | const drawingInfo = this.drawingInfo(); |
| 493 | |
| 494 | context.save(); |
| 495 | context.translate( |
| 496 | -size.width / 2, |
| 497 | -size.height / 2 + drawingInfo.verticalOffset, |
| 498 | ); |
| 499 | |
| 500 | const drawHooks = this.drawHooks(); |
| 501 | for (const info of drawingInfo.fragments) { |
| 502 | context.save(); |
| 503 | context.globalAlpha *= info.alpha; |
| 504 | drawHooks.token(context, info.text, info.position, info.fill, info.time); |
| 505 | context.restore(); |
| 506 | } |
| 507 | |
| 508 | context.restore(); |
| 509 | |
| 510 | await this.drawChildren(context); |
| 511 | } |
| 512 | |
| 513 | protected override applyText(context: CanvasRenderingContext2D) { |
| 514 | super.applyText(context); |
nothing calls this directly
no test coverage detected