Commit c2a0423
committed
fix(ai): surrogate pair rendering in smd water-flow animation
Characters outside BMP (math symbols 𝛼𝛽, emoji 🧠, rare CJK 𠮷)
are surrogate pairs in UTF-16. The old for(i;i<text.length;i++) loop
split them into two unpaired surrogates → browser showed □ blocks.
Fixes:
- text iteration: for..of (iterates by code point, not code unit)
- _isCJK: charCodeAt → codePointAt + add CJK extension B~F range1 parent 0ae96b0 commit c2a0423
1 file changed
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
363 | | - | |
| 363 | + | |
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
369 | | - | |
| 369 | + | |
| 370 | + | |
370 | 371 | | |
371 | 372 | | |
372 | 373 | | |
373 | 374 | | |
374 | 375 | | |
375 | 376 | | |
376 | 377 | | |
377 | | - | |
378 | | - | |
| 378 | + | |
| 379 | + | |
379 | 380 | | |
380 | 381 | | |
381 | 382 | | |
| |||
0 commit comments