1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00
This commit is contained in:
Skident 2025-12-25 18:58:51 +00:00 committed by GitHub
commit b818cf0199
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 62 additions and 2 deletions

View file

@ -47,11 +47,12 @@ public:
void reset (const Rectangle<int>& finalBounds,
float finalAlpha,
int millisecondsBeforeStartMoving,
int millisecondsToSpendMoving,
bool useProxyComponent,
double startSpd, double endSpd)
{
msElapsed = 0;
msElapsed = -jmax (0, millisecondsBeforeStartMoving);
msTotal = jmax (1, millisecondsToSpendMoving);
lastProgress = 0;
destination = finalBounds;
@ -85,6 +86,8 @@ public:
: component.get())
{
msElapsed += elapsed;
if (msElapsed < 0)
return true;
double newProgress = msElapsed / (double) msTotal;
if (newProgress >= 0 && newProgress < 1.0)
@ -243,6 +246,18 @@ void ComponentAnimator::animateComponent (Component* const component,
const bool useProxyComponent,
const double startSpeed,
const double endSpeed)
{
animateComponent(component, finalBounds, finalAlpha, 0, millisecondsToSpendMoving, useProxyComponent, startSpeed, endSpeed);
}
void ComponentAnimator::animateComponent (Component* const component,
const Rectangle<int>& finalBounds,
const float finalAlpha,
const int millisecondsBeforeStartMoving,
const int millisecondsToSpendMoving,
const bool useProxyComponent,
const double startSpeed,
const double endSpeed)
{
// the speeds must be 0 or greater!
jassert (startSpeed >= 0 && endSpeed >= 0);
@ -258,7 +273,8 @@ void ComponentAnimator::animateComponent (Component* const component,
sendChangeMessage();
}
at->reset (finalBounds, finalAlpha, millisecondsToSpendMoving,
at->reset (finalBounds, finalAlpha,
millisecondsBeforeStartMoving, millisecondsToSpendMoving,
useProxyComponent, startSpeed, endSpeed);
if (! isTimerRunning())