submodule: add rive-cpp to rive-tizen as submodule
[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* parent)
8 {
9         if (parent->is<ShapePaint>())
10         {
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 {
21         if (m_RenderOpacity == value)
22         {
23                 return;
24         }
25         m_RenderOpacity = value;
26         renderOpacityChanged();
27 }