blob: 0b58b87bd58d98e9ae33b3b96829e82db52b457c [file]
#include "rive/text/text_style_axis.hpp"
#include "rive/text/text_style.hpp"
#include "rive/container_component.hpp"
using namespace rive;
StatusCode TextStyleAxis::onAddedDirty(CoreContext* context)
{
StatusCode code = Super::onAddedDirty(context);
#ifndef WITH_RIVE_EDITOR
// Runtime-only; editor build registers via editorParentChanged.
if (code == StatusCode::Ok)
{
if (!parent()->is<TextStyle>())
{
return StatusCode::InvalidObject;
}
auto style = parent()->as<TextStyle>();
style->addVariation(this);
}
#endif
return code;
}
void TextStyleAxis::tagChanged()
{
parent()->addDirt(ComponentDirt::TextShape);
}
void TextStyleAxis::axisValueChanged()
{
parent()->addDirt(ComponentDirt::TextShape);
}