[common] code clean up

use fmodf() instead of fmod()
This commit is contained in:
Vincent Torri 2024-03-22 21:09:52 +01:00 committed by Hermet Park
parent 04977c43f1
commit 2ec9fdb932
3 changed files with 3 additions and 3 deletions

View file

@ -50,7 +50,7 @@ void LottieTrimpath::segment(float frameNo, float& start, float& end)
{ {
auto s = this->start(frameNo) * 0.01f; auto s = this->start(frameNo) * 0.01f;
auto e = this->end(frameNo) * 0.01f; auto e = this->end(frameNo) * 0.01f;
auto o = fmod(this->offset(frameNo), 360.0f) / 360.0f; //0 ~ 1 auto o = fmodf(this->offset(frameNo), 360.0f) / 360.0f; //0 ~ 1
auto diff = fabs(s - e); auto diff = fabs(s - e);
if (mathZero(diff)) { if (mathZero(diff)) {

View file

@ -743,7 +743,7 @@ static Matrix* _parseTransformationMatrix(const char* value)
} else goto error; } else goto error;
} else if (state == MatrixState::Rotate) { } else if (state == MatrixState::Rotate) {
//Transform to signed. //Transform to signed.
points[0] = fmod(points[0], 360); points[0] = fmodf(points[0], 360.0f);
if (points[0] < 0) points[0] += 360.0f; if (points[0] < 0) points[0] += 360.0f;
auto c = cosf(points[0] * (MATH_PI / 180.0f)); auto c = cosf(points[0] * (MATH_PI / 180.0f));
auto s = sinf(points[0] * (MATH_PI / 180.0f)); auto s = sinf(points[0] * (MATH_PI / 180.0f));

View file

@ -279,7 +279,7 @@ static SwOutline* _genDashOutline(const RenderShape* rshape, const Matrix* trans
bool isOdd = dash.cnt % 2; bool isOdd = dash.cnt % 2;
if (isOdd) patternLength *= 2; if (isOdd) patternLength *= 2;
offset = fmod(offset, patternLength); offset = fmodf(offset, patternLength);
if (offset < 0) offset += patternLength; if (offset < 0) offset += patternLength;
for (size_t i = 0; i < dash.cnt * (1 + (size_t)isOdd); ++i, ++offIdx) { for (size_t i = 0; i < dash.cnt * (1 + (size_t)isOdd); ++i, ++offIdx) {