submodule: add rive-cpp to rive-tizen as submodule
[platform/core/uifw/rive-tizen.git] / submodule / src / shapes / paint / gradient_stop.cpp
1 #include "shapes/paint/gradient_stop.hpp"
2 #include "shapes/paint/linear_gradient.hpp"
3
4 using namespace rive;
5
6 StatusCode GradientStop::onAddedDirty(CoreContext* context)
7 {
8         StatusCode code = Super::onAddedDirty(context);
9         if (code != StatusCode::Ok)
10         {
11                 return code;
12         }
13         
14         if (!parent()->is<LinearGradient>())
15         {
16                 return StatusCode::MissingObject;
17         }
18         parent()->as<LinearGradient>()->addStop(this);
19         return StatusCode::Ok;
20 }
21
22 void GradientStop::colorValueChanged()
23 {
24         parent()->as<LinearGradient>()->markGradientDirty();
25 }
26 void GradientStop::positionChanged()
27 {
28         parent()->as<LinearGradient>()->markStopsDirty();
29 }