mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2025-03-02 17:50:13 +00:00
path animation always not equals
Signed-off-by: sunfei <sunfei.sun@huawei.com> Change-Id: I372b5156e85a7e2e1189f2c53f6a8550b8393966
This commit is contained in:
parent
509c86c737
commit
bcd74b112a
@ -188,12 +188,21 @@ public:
|
||||
|
||||
Matrix4 ComputerRemaining(std::size_t startOffset) const;
|
||||
|
||||
void SetAlwaysRotate(bool alwaysRotate)
|
||||
{
|
||||
alwaysRotate_ = alwaysRotate;
|
||||
}
|
||||
|
||||
bool operator==(const TransformOperations& other) const
|
||||
{
|
||||
bool equals = false;
|
||||
if (alwaysRotate_) {
|
||||
return false;
|
||||
}
|
||||
if (operations_.size() != other.operations_.size()) {
|
||||
return false;
|
||||
}
|
||||
for (size_t index = 0; index < operations_.size(); index++) {
|
||||
equals = equals | operations_[index] == other.operations_[index];
|
||||
if (!equals) {
|
||||
if (!(operations_[index] == other.operations_[index])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -202,6 +211,7 @@ public:
|
||||
|
||||
protected:
|
||||
std::vector<TransformOperation> operations_;
|
||||
bool alwaysRotate_ = false;
|
||||
|
||||
private:
|
||||
std::size_t MatchingLength(const TransformOperations& to, const TransformOperations& from) const;
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
|
||||
void AnimateTo(const T& beginValue, const T& endValue)
|
||||
{
|
||||
if (endValue_ == endValue) {
|
||||
if (endValue == endValue_) {
|
||||
return;
|
||||
}
|
||||
endValue_ = endValue;
|
||||
|
@ -140,14 +140,17 @@ public:
|
||||
{
|
||||
operations_ = other;
|
||||
blended = TransformOperations(operations_);
|
||||
endValue_ = blended;
|
||||
}
|
||||
|
||||
void PlayTransformAnimation(const AnimationOption& option, const std::vector<TransformOperation>& other)
|
||||
void PlayTransformAnimation(
|
||||
const AnimationOption& option, const std::vector<TransformOperation>& other, bool alwaysRotate = false)
|
||||
{
|
||||
SetAnimationOption(option);
|
||||
auto target = TransformOperations(other);
|
||||
TransformOperations::ParseOperationsToMatrix(operations_);
|
||||
TransformOperations::ParseOperationsToMatrix(target.GetOperations());
|
||||
target.SetAlwaysRotate(alwaysRotate);
|
||||
AnimateTo(blended, target);
|
||||
// just move to target, renderNode should use blended to computer matrix
|
||||
MoveTo(target);
|
||||
|
@ -135,7 +135,7 @@ public:
|
||||
renderNode->transformAnimation_.SetEvaluator(nullptr);
|
||||
}
|
||||
});
|
||||
transformAnimation_.PlayTransformAnimation(option, std::vector<TransformOperation>());
|
||||
transformAnimation_.PlayTransformAnimation(option, std::vector<TransformOperation>(), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user