submodule: add rive-cpp to rive-tizen as submodule
[platform/core/uifw/rive-tizen.git] / submodule / src / shapes / paint / solid_color.cpp
1 #include "shapes/paint/solid_color.hpp"
2 #include "container_component.hpp"
3 #include "renderer.hpp"
4 #include "shapes/paint/color.hpp"
5
6 using namespace rive;
7
8 StatusCode SolidColor::onAddedDirty(CoreContext* context)
9 {
10         StatusCode code = Super::onAddedDirty(context);
11         if (code != StatusCode::Ok)
12         {
13                 return code;
14         }
15         if (!initPaintMutator(parent()))
16         {
17                 return StatusCode::MissingObject;
18         }
19         renderOpacityChanged();
20         return StatusCode::Ok;
21 }
22
23 void SolidColor::renderOpacityChanged()
24 {
25         if (renderPaint() == nullptr)
26         {
27                 return;
28         }
29         renderPaint()->color(
30             colorModulateOpacity((unsigned int)colorValue(), renderOpacity()));
31 }
32
33 void SolidColor::colorValueChanged() { renderOpacityChanged(); }