mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
portability: addressed all compilation warnings from MSVC
This commit is contained in:
parent
bb30db429e
commit
f3a2d2a5a6
2 changed files with 4 additions and 4 deletions
|
@ -545,15 +545,15 @@ struct LottieComposition
|
||||||
return frameCnt() / frameRate; // in second
|
return frameCnt() / frameRate; // in second
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t frameAtTime(float timeInSec) const
|
float frameAtTime(float timeInSec) const
|
||||||
{
|
{
|
||||||
auto p = timeInSec / duration();
|
auto p = timeInSec / duration();
|
||||||
if (p < 0.0f) p = 0.0f;
|
if (p < 0.0f) p = 0.0f;
|
||||||
else if (p > 1.0f) p = 1.0f;
|
else if (p > 1.0f) p = 1.0f;
|
||||||
return (int32_t)lroundf(p * frameCnt());
|
return p * frameCnt();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t frameCnt() const
|
float frameCnt() const
|
||||||
{
|
{
|
||||||
return endFrame - startFrame;
|
return endFrame - startFrame;
|
||||||
}
|
}
|
||||||
|
|
|
@ -218,7 +218,7 @@ SwFixed mathLength(const SwPoint& pt)
|
||||||
than 7% compared to the exact value. */
|
than 7% compared to the exact value. */
|
||||||
if (v.x < 0) v.x = -v.x;
|
if (v.x < 0) v.x = -v.x;
|
||||||
if (v.y < 0) v.y = -v.y;
|
if (v.y < 0) v.y = -v.y;
|
||||||
return (v.x > v.y) ? (v.x + v.y * 0.375f) : (v.y + v.x * 0.375f);
|
return static_cast<SwFixed>((v.x > v.y) ? (v.x + v.y * 0.375f) : (v.y + v.x * 0.375f));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue