blob: 4f7ab45e82063d30a71f0348c0d44c41a7574c02 [file] [log] [blame]
#include "rive/draw_target.hpp"
#include "rive/core_context.hpp"
#include "rive/drawable.hpp"
#include "rive/artboard.hpp"
using namespace rive;
StatusCode DrawTarget::onAddedDirty(CoreContext* context) {
StatusCode code = Super::onAddedDirty(context);
if (code != StatusCode::Ok) {
return code;
}
auto coreObject = context->resolve(drawableId());
if (coreObject == nullptr || !coreObject->is<Drawable>()) {
return StatusCode::MissingObject;
}
m_Drawable = reinterpret_cast<Drawable*>(coreObject);
return StatusCode::Ok;
}
StatusCode DrawTarget::onAddedClean(CoreContext* context) { return StatusCode::Ok; }
void DrawTarget::placementValueChanged() { artboard()->addDirt(ComponentDirt::DrawOrder); }