blob: d8c1d8abe3723cf9aaa13c128ab154677720c048 [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();
}