Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
holycanvas committed Oct 17, 2023
1 parent 2c875d1 commit d6a2ecc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion native/cocos/particle/ParticleSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void ParticleSystem::removeModule(ParticleSystemModule& module) {
break;
}

auto& index = std::find(stage->begin(), stage->end(), &module);
auto index = std::find(stage->begin(), stage->end(), &module);
if (index != stage->end()) {
stage->erase(index);
}
Expand Down
4 changes: 2 additions & 2 deletions native/cocos/particle/modules/DistributableShape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ float DistributableShape::getDistributionAlpha(ParticleSystemContext& context, s
if (spread > math::EPSILON) {
current = std::floor(current / spread) * spread;
}
current = std::modf(current, distributionRange);
current -= std::floor(current / distributionRange) * distributionRange;
return current >= 0 ? current : current + distributionRange;
} else if constexpr (mode == DistributionMode::PING_PONG) {
float current = MathUtil::lerp(begin, end, alpha);
alpha += interval;
if (spread > math::EPSILON) {
current = std::floor(current / spread) * spread;
}
current = std::modf(current, 2.0 * distributionRange);
current -= std::floor(current / (2.0 * distributionRange)) * (2.0 * distributionRange);
return current > distributionRange ? (2.0 * distributionRange - current) : current;
} else {
float current = alpha * distributionRange;
Expand Down

0 comments on commit d6a2ecc

Please sign in to comment.