Skip to content

Commit 6731c21

Browse files
committed
feat: opt code
1 parent e6a170e commit 6731c21

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/core/src/animation/Animator.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ export class Animator extends Component {
695695
destPlayData.update(destCostTime);
696696

697697
let crossWeight = Math.abs(destPlayData.frameTime) / transitionDuration;
698-
(crossWeight >= 1.0 || transitionDuration === 0) && (crossWeight = 1.0);
698+
(crossWeight >= 1.0 - MathUtil.zeroTolerance || transitionDuration === 0) && (crossWeight = 1.0);
699699

700700
const crossFadeFinished = crossWeight === 1.0;
701701

@@ -819,7 +819,7 @@ export class Animator extends Component {
819819
destPlayData.update(destCostTime);
820820

821821
let crossWeight = Math.abs(destPlayData.frameTime) / transitionDuration;
822-
(crossWeight >= 1.0 || transitionDuration === 0) && (crossWeight = 1.0);
822+
(crossWeight >= 1.0 - MathUtil.zeroTolerance || transitionDuration === 0) && (crossWeight = 1.0);
823823

824824
const crossFadeFinished = crossWeight === 1.0;
825825

0 commit comments

Comments
 (0)