From b6ce2a5dfcc948c600b499c11019b0fdee799607 Mon Sep 17 00:00:00 2001 From: kevingpqi123 Date: Tue, 23 Apr 2024 12:36:42 +0800 Subject: [PATCH] Fix the issue of inconsistent contentDuration values obtained from PAGImageLayer between iOS and Android platforms. (#2265) Co-authored-by: kevingpqi --- src/rendering/layers/PAGImageLayer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rendering/layers/PAGImageLayer.cpp b/src/rendering/layers/PAGImageLayer.cpp index 1935575914..7c1a141e5d 100644 --- a/src/rendering/layers/PAGImageLayer.cpp +++ b/src/rendering/layers/PAGImageLayer.cpp @@ -411,10 +411,10 @@ Frame PAGImageLayer::ScaleTimeRemap(AnimatableProperty* property, if (keyframe->startTime < 0) { CutKeyframe(keyframe, 0, true); } - minValue = std::floor(std::min(keyframe->startValue, minValue)); - minValue = std::floor(std::min(keyframe->endValue, minValue)); - maxValue = std::floor(std::max(keyframe->startValue, maxValue)); - maxValue = std::floor(std::max(keyframe->endValue, maxValue)); + minValue = std::round(std::min(keyframe->startValue, minValue)); + minValue = std::round(std::min(keyframe->endValue, minValue)); + maxValue = std::round(std::max(keyframe->startValue, maxValue)); + maxValue = std::round(std::max(keyframe->endValue, maxValue)); } for (auto& keyframe : keyframes) { keyframe->startValue -= minValue;