mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Merge d7416fab70 into 29396c22c9
This commit is contained in:
commit
b818cf0199
2 changed files with 62 additions and 2 deletions
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue