(
ctx: RenderingContext2D,
text?: string
)
| 306 | } |
| 307 | |
| 308 | protected override measureText( |
| 309 | ctx: RenderingContext2D, |
| 310 | text?: string |
| 311 | ) { |
| 312 | const { measuresCache } = this |
| 313 | const targetText = text || this.getText() |
| 314 | |
| 315 | if (measuresCache.has(targetText)) { |
| 316 | return measuresCache.get(targetText) |
| 317 | } |
| 318 | |
| 319 | const measure = this.measureTargetText(ctx, targetText) |
| 320 | |
| 321 | measuresCache.set(targetText, measure) |
| 322 | |
| 323 | return measure |
| 324 | } |
| 325 | |
| 326 | // This method supposes what all custom fonts already loaded. |
| 327 | // If some font will be loaded after this method call, <textPath> will not be rendered correctly. |
no test coverage detected