mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-09 14:13:43 +00:00
lottie: --type casting warning in MSVC
This commit is contained in:
parent
1daf6a010c
commit
d2c89a5f2d
3 changed files with 6 additions and 6 deletions
|
@ -1064,7 +1064,7 @@ void LottieBuilder::updateText(LottieLayer* layer, float frameNo)
|
||||||
//text range process
|
//text range process
|
||||||
for (auto s = text->ranges.begin(); s < text->ranges.end(); ++s) {
|
for (auto s = text->ranges.begin(); s < text->ranges.end(); ++s) {
|
||||||
float start, end;
|
float start, end;
|
||||||
(*s)->range(frameNo, totalChars, start, end);
|
(*s)->range(frameNo, float(totalChars), start, end);
|
||||||
|
|
||||||
auto basedIdx = idx;
|
auto basedIdx = idx;
|
||||||
if ((*s)->based == LottieTextRange::Based::CharsExcludingSpaces) basedIdx = idx - space;
|
if ((*s)->based == LottieTextRange::Based::CharsExcludingSpaces) basedIdx = idx - space;
|
||||||
|
|
|
@ -110,9 +110,9 @@ void LottieSlot::assign(LottieObject* target)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LottieTextRange::range(float frameNo, size_t totalLen, float& start, float& end)
|
void LottieTextRange::range(float frameNo, float totalLen, float& start, float& end)
|
||||||
{
|
{
|
||||||
float divisor = rangeUnit == Unit::Percent ? (100.0f / totalLen) : 1;
|
auto divisor = (rangeUnit == Unit::Percent) ? (100.0f / totalLen) : 1.0f;
|
||||||
auto offset = this->offset(frameNo) / divisor;
|
auto offset = this->offset(frameNo) / divisor;
|
||||||
start = nearbyintf(this->start(frameNo) / divisor) + offset;
|
start = nearbyintf(this->start(frameNo) / divisor) + offset;
|
||||||
end = nearbyintf(this->end(frameNo) / divisor) + offset;
|
end = nearbyintf(this->end(frameNo) / divisor) + offset;
|
||||||
|
@ -122,8 +122,8 @@ void LottieTextRange::range(float frameNo, size_t totalLen, float& start, float&
|
||||||
if (random == 0) return;
|
if (random == 0) return;
|
||||||
|
|
||||||
auto range = end - start;
|
auto range = end - start;
|
||||||
auto len = rangeUnit == Unit::Percent ? 100 : totalLen;
|
auto len = (rangeUnit == Unit::Percent) ? 100.0f : totalLen;
|
||||||
start = random % int(len - range);
|
start = static_cast<float>(random % int(len - range));
|
||||||
end = start + range;
|
end = start + range;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,7 @@ struct LottieTextRange
|
||||||
uint8_t random = 0;
|
uint8_t random = 0;
|
||||||
bool expressible = false;
|
bool expressible = false;
|
||||||
|
|
||||||
void range(float frameNo, size_t totalLen, float& start, float& end);
|
void range(float frameNo, float totalLen, float& start, float& end);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue