blob: fa9f5167f2e31400dd04b129abd108f3f92baca0 [file] [log] [blame]
#include "rive/shapes/paint/gradient_stop.hpp"
#include "rive/shapes/paint/linear_gradient.hpp"
using namespace rive;
StatusCode GradientStop::onAddedDirty(CoreContext* context)
{
StatusCode code = Super::onAddedDirty(context);
if (code != StatusCode::Ok)
{
return code;
}
if (!parent()->is<LinearGradient>())
{
return StatusCode::MissingObject;
}
parent()->as<LinearGradient>()->addStop(this);
return StatusCode::Ok;
}
void GradientStop::colorValueChanged()
{
parent()->as<LinearGradient>()->markGradientDirty();
}
void GradientStop::positionChanged()
{
parent()->as<LinearGradient>()->markStopsDirty();
}