BugFix reverse Alpha source callback

This commit is contained in:
Bruno Herbelin
2024-12-27 09:45:23 +01:00
parent 29ef6c134e
commit 76a96e39bd

View File

@@ -246,7 +246,7 @@ SourceCallback *ResetGeometry::clone() const
SetAlpha::SetAlpha(float alpha, float ms, bool revert) : SourceCallback(),
duration_(ms), alpha_(alpha), bidirectional_(revert)
{
alpha_ = glm::clamp(alpha_, -1.f, 1.f);
alpha_ = glm::clamp(alpha_, -3.f, 1.f);
start_ = glm::vec2();
target_ = glm::vec2();
}
@@ -334,7 +334,7 @@ SourceCallback *SetAlpha::reverse(Source *s) const
{
float _a = glm::length( glm::vec2(s->group(View::MIXING)->translation_) );
if (_a > 1.f)
_a *= -1.f;
_a = -_a +1.f;
else
_a = s->alpha();