Commit 563390b2 authored by Fredrik Söderquist's avatar Fredrik Söderquist Committed by Commit Bot

Use clampTo<int> in SVGInteger::CalculateAnimatedValue

Matches what we do in SVGIntegerOptionalInteger::CalculateAnimatedValue,
and avoids undefined overflow.

Bug: 899445
Change-Id: I1250a05482713780f707301ed29e015fd81e65f2
Reviewed-on: https://chromium-review.googlesource.com/c/1304483Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#603548}
parent 444889cd
......@@ -79,7 +79,7 @@ void SVGInteger::CalculateAnimatedValue(SVGAnimationElement* animation_element,
animation_element->AnimateAdditiveNumber(
percentage, repeat_count, from_integer->Value(), to_integer->Value(),
to_at_end_of_duration_integer->Value(), animated_float);
value_ = static_cast<int>(roundf(animated_float));
value_ = clampTo<int>(roundf(animated_float));
}
float SVGInteger::CalculateDistance(SVGPropertyBase* other, SVGElement*) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment