Merge remote-tracking branch 'origin/develop' into local-test
All checks were successful
CI / Docker-Build (push) Successful in 2m8s

This commit is contained in:
joylink_fanyuhong 2024-05-09 15:43:48 +08:00
commit 60ca381302
2 changed files with 3 additions and 2 deletions

@ -1 +1 @@
Subproject commit 56e1948393aa51e0bf16d754292a211f348df161
Subproject commit e4c55ea4b6f9f5f875d59fc5bba51fc21bc8ef97

View File

@ -637,9 +637,10 @@ export class Train extends JlGraphic {
}
const offset = this.states.headOffset / allLength; // 百分比偏移
let offsetL = totalLength * offset;
// 0.01为保证浮点数计算误差
const indexP = lengths.findIndex((l) => {
offsetL -= l;
return offsetL <= 0;
return offsetL <= 0.001;
});
const startP = points[indexP];
const endP = points[indexP + 1];