Skip to content

Commit

Permalink
[cpp] Ported scale mixing fix, see EsotericSoftware#2028.
Browse files Browse the repository at this point in the history
  • Loading branch information
badlogic committed Jan 26, 2022
1 parent c8fe2c8 commit 65c62bf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spine-cpp/spine-cpp/src/spine/ScaleTimeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ void ScaleTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector
bone->_scaleY = by + (MathUtil::abs(y) * MathUtil::sign(by) - by) * alpha;
break;
case MixBlend_Add:
bone->_scaleX = (x - bone->_data._scaleX) * alpha;
bone->_scaleY = (y - bone->_data._scaleY) * alpha;
bone->_scaleX += (x - bone->_data._scaleX) * alpha;
bone->_scaleY += (y - bone->_data._scaleY) * alpha;
}
} else {
switch (blend) {
Expand Down Expand Up @@ -210,7 +210,7 @@ void ScaleXTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vecto
bone->_scaleX = bx + (MathUtil::abs(x) * MathUtil::sign(bx) - bx) * alpha;
break;
case MixBlend_Add:
bone->_scaleX = (x - bone->_data._scaleX) * alpha;
bone->_scaleX += (x - bone->_data._scaleX) * alpha;
}
} else {
switch (blend) {
Expand Down Expand Up @@ -283,7 +283,7 @@ void ScaleYTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vecto
bone->_scaleY = by + (MathUtil::abs(y) * MathUtil::sign(by) - by) * alpha;
break;
case MixBlend_Add:
bone->_scaleY = (y - bone->_data._scaleY) * alpha;
bone->_scaleY += (y - bone->_data._scaleY) * alpha;
}
} else {
switch (blend) {
Expand Down

0 comments on commit 65c62bf

Please sign in to comment.