mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
[common] code clean up
use fmodf() instead of fmod()
This commit is contained in:
parent
04977c43f1
commit
2ec9fdb932
3 changed files with 3 additions and 3 deletions
|
@ -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)) {
|
||||||
|
|
|
@ -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));
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue