Update rive-cpp to 2.0 version
[platform/core/uifw/rive-tizen.git] / submodule / rive-cpp / src / shapes / paint / shape_paint_mutator.cpp
1 #include "rive/shapes/paint/shape_paint_mutator.hpp"
2 #include "rive/component.hpp"
3 #include "rive/shapes/paint/shape_paint.hpp"
4
5 using namespace rive;
6
7 bool ShapePaintMutator::initPaintMutator(Component* component) {
8     auto parent = component->parent();
9     m_Component = component;
10     if (parent->is<ShapePaint>()) {
11         // Set this object as the mutator for the shape paint and get a
12         // reference to the paint we'll be mutating.
13         m_RenderPaint = parent->as<ShapePaint>()->initRenderPaint(this);
14         return true;
15     }
16     return false;
17 }
18
19 void ShapePaintMutator::renderOpacity(float value) {
20     if (m_RenderOpacity == value) {
21         return;
22     }
23     m_RenderOpacity = value;
24     renderOpacityChanged();
25 }