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