diff --git a/.gitignore b/.gitignore index 9d3dbca..d89ad31 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ helper/local coverage npm docs -.DS_Store \ No newline at end of file +.DS_Store +test \ No newline at end of file diff --git a/helper/version.md b/helper/version.md index 05c9df3..a570ab2 100644 --- a/helper/version.md +++ b/helper/version.md @@ -8,6 +8,12 @@ 6. 查询包含某个汉字(笔画序列)的所有汉字【如根据斌字查到赟】 7. 判断某个汉字是否包含某个汉字【如赟字是否包含斌】 +## 3.2.6 + +1. 修复 radicalToWord 当部首笔画数大于等于10时结果错误的bug +2. 修复 loopAnimate=false 时animateComplete无法正确执行的bug +3. 修正 饿 字读音 + ## 3.2.5 1. name 插件字符问题 diff --git a/public/index.ts b/public/index.ts index 05c7133..35f5919 100644 --- a/public/index.ts +++ b/public/index.ts @@ -109,7 +109,7 @@ cnchar.draw('你好九', { animateComplete () { console.log('animateComplete'); }, - loopAnimate: true, + loopAnimate: false, autoAnimate: true, // false 时点击出发animate 只能触发一次 stepByStep: false }, diff --git a/src/cnchar/main/dict/spell-dict-jian.json b/src/cnchar/main/dict/spell-dict-jian.json index aaa35ce..3b3f616 100644 --- a/src/cnchar/main/dict/spell-dict-jian.json +++ b/src/cnchar/main/dict/spell-dict-jian.json @@ -126,7 +126,7 @@ "bian": "2:卞4弁4边1忭4汴4苄4贬3便9变4扁8砭1窆3匾3笾1缏9编1遍4煸1碥3褊8蝙1辨4辩4辫4鳊1鞭1釆4", "pian": "2:片9片6便7扁6骈2胼2偏1谝3缏7骗4犏1褊7篇1翩1蹁2", "a": "0:吖6阿6阿9阿8呵6啊6啊7啊8啊9腌6锕1嗄7呵5啊5", - "e": "0:厄3讹2扼3苊3阿6轭3俄2垩3哦7娥2婀1屙1峨2恶9恶8胺8莪2饿3谔3鄂3阏8愕3萼3遏9遏8锇2鹅2腭3蛾7锷3鹗3颚4额2噩3鳄3呃4噁2", + "e": "0:厄3讹2扼3苊3阿6轭3俄2垩3哦7娥2婀1屙1峨2恶9恶8胺8莪2饿4谔3鄂3阏8愕3萼3遏9遏8锇2鹅2腭3蛾7锷3鹗3颚4额2噩3鳄3呃4噁2", "ting": "1:厅1汀1廷2听1町6亭2庭2挺3烃1莛2梃9梃8停2铤8婷2艇3葶2蜓2霆2珽3", "shuang": "3:双1泷6爽6爽8霜1孀1", "tian": "2:天1田2佃7忝3恬2殄3畋2钿7掭4添1甜2腆3嗔7填2阗2舔3湉2畑2", diff --git a/src/cnchar/plugin/draw/animation-stroke.ts b/src/cnchar/plugin/draw/animation-stroke.ts index 59c4553..7746893 100644 --- a/src/cnchar/plugin/draw/animation-stroke.ts +++ b/src/cnchar/plugin/draw/animation-stroke.ts @@ -2,7 +2,7 @@ * @Author: theajack * @Date: 2021-08-05 23:05:21 * @LastEditor: theajack - * @LastEditTime: 2023-03-18 21:37:32 + * @LastEditTime: 2024-03-23 10:19:46 * @Description: Coding something * @FilePath: \cnchar\src\cnchar\plugin\draw\animation-stroke.ts */ @@ -119,7 +119,7 @@ export class AnimationWriter { if (this.option.loopAnimate) { this._loop(); } else { - this._animate(this._onAnimateComplete); + this._animate(this._onAnimateComplete.bind(this)); } } diff --git a/src/cnchar/plugin/radical/radical.ts b/src/cnchar/plugin/radical/radical.ts index 1a6d793..e91a45a 100644 --- a/src/cnchar/plugin/radical/radical.ts +++ b/src/cnchar/plugin/radical/radical.ts @@ -136,7 +136,7 @@ function radicalToWordBase (radical: string, dict: Json) { _warn(`错误的偏旁部首:${radical}`); return []; } - let index = 2, gap = 2; + let index = str.indexOf(':') + 1, gap = 2; if (radical === '*') { index = 0; gap = 3;