This source file includes following definitions.
- interpolateTo
- addWith
- equalTo
- trace
#include "config.h"
#include "core/animation/AnimatableLengthBox.h"
namespace WebCore {
PassRefPtrWillBeRawPtr<AnimatableValue> AnimatableLengthBox::interpolateTo(const AnimatableValue* value, double fraction) const
{
const AnimatableLengthBox* lengthBox = toAnimatableLengthBox(value);
return AnimatableLengthBox::create(
AnimatableValue::interpolate(this->left(), lengthBox->left(), fraction),
AnimatableValue::interpolate(this->right(), lengthBox->right(), fraction),
AnimatableValue::interpolate(this->top(), lengthBox->top(), fraction),
AnimatableValue::interpolate(this->bottom(), lengthBox->bottom(), fraction));
}
PassRefPtrWillBeRawPtr<AnimatableValue> AnimatableLengthBox::addWith(const AnimatableValue* value) const
{
const AnimatableLengthBox* lengthBox = toAnimatableLengthBox(value);
return AnimatableLengthBox::create(
AnimatableValue::add(this->left(), lengthBox->left()),
AnimatableValue::add(this->right(), lengthBox->right()),
AnimatableValue::add(this->top(), lengthBox->top()),
AnimatableValue::add(this->bottom(), lengthBox->bottom()));
}
bool AnimatableLengthBox::equalTo(const AnimatableValue* value) const
{
const AnimatableLengthBox* lengthBox = toAnimatableLengthBox(value);
return left()->equals(lengthBox->left())
&& right()->equals(lengthBox->right())
&& top()->equals(lengthBox->top())
&& bottom()->equals(lengthBox->bottom());
}
void AnimatableLengthBox::trace(Visitor* visitor)
{
visitor->trace(m_left);
visitor->trace(m_right);
visitor->trace(m_top);
visitor->trace(m_bottom);
}
}