mirror of
https://github.com/rive-app/rive-cpp.git
synced 2026-01-18 21:21:17 +01:00
chore: complete groups path effects work (#11373) 8f9dae9f36
* fix effects sorting * fix Feature values * invalidate effects on update instead than when dirt is added to avoid multiple invalidations per frame * fix key conflict Co-authored-by: hernan <hernan@rive.app>
This commit is contained in:
@@ -1 +1 @@
|
|||||||
df0db41a9cc7bd37e8421431f95952df21890faf
|
8f9dae9f361595302907e90ef18335b66c83d988
|
||||||
|
|||||||
@@ -5,6 +5,9 @@
|
|||||||
"string": "scriptinputviewmodelproperty"
|
"string": "scriptinputviewmodelproperty"
|
||||||
},
|
},
|
||||||
"extends": "custom_property.json",
|
"extends": "custom_property.json",
|
||||||
|
"mixins": [
|
||||||
|
"script_input_common.json"
|
||||||
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"dataTypeId": {
|
"dataTypeId": {
|
||||||
"type": "Id",
|
"type": "Id",
|
||||||
@@ -31,7 +34,7 @@
|
|||||||
"type": "bool",
|
"type": "bool",
|
||||||
"initialValue": "false",
|
"initialValue": "false",
|
||||||
"key": {
|
"key": {
|
||||||
"int": 922,
|
"int": 925,
|
||||||
"string": "isdatabindpathrelative"
|
"string": "isdatabindpathrelative"
|
||||||
},
|
},
|
||||||
"description": "Whether the data bind path is relative",
|
"description": "Whether the data bind path is relative",
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ public:
|
|||||||
AdvanceFlags flags = AdvanceFlags::Animate |
|
AdvanceFlags flags = AdvanceFlags::Animate |
|
||||||
AdvanceFlags::NewFrame) override;
|
AdvanceFlags::NewFrame) override;
|
||||||
bool addScriptedDirt(ComponentDirt value, bool recurse = false) override;
|
bool addScriptedDirt(ComponentDirt value, bool recurse = false) override;
|
||||||
|
void buildDependencies() override;
|
||||||
|
void update(ComponentDirt value) override;
|
||||||
DataContext* dataContext() override
|
DataContext* dataContext() override
|
||||||
{
|
{
|
||||||
if (artboard() != nullptr)
|
if (artboard() != nullptr)
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ public:
|
|||||||
void addPathProvider(PathProvider* component) override;
|
void addPathProvider(PathProvider* component) override;
|
||||||
void addStrokeEffect(StrokeEffect* effect) override;
|
void addStrokeEffect(StrokeEffect* effect) override;
|
||||||
void invalidateEffect(PathProvider* effect) override;
|
void invalidateEffect(PathProvider* effect) override;
|
||||||
|
void buildDependencies() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<TargetEffect*> m_targetEffects;
|
std::vector<TargetEffect*> m_targetEffects;
|
||||||
|
|||||||
@@ -114,7 +114,6 @@ bool ScriptedPathEffect::advanceComponent(float elapsedSeconds,
|
|||||||
|
|
||||||
bool ScriptedPathEffect::addScriptedDirt(ComponentDirt value, bool recurse)
|
bool ScriptedPathEffect::addScriptedDirt(ComponentDirt value, bool recurse)
|
||||||
{
|
{
|
||||||
invalidateEffectFromLocal();
|
|
||||||
return Component::addDirt(value, recurse);
|
return Component::addDirt(value, recurse);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,4 +161,23 @@ EffectsContainer* ScriptedPathEffect::parentPaint()
|
|||||||
EffectPath* ScriptedPathEffect::createEffectPath()
|
EffectPath* ScriptedPathEffect::createEffectPath()
|
||||||
{
|
{
|
||||||
return new ScriptedEffectPath();
|
return new ScriptedEffectPath();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScriptedPathEffect::buildDependencies()
|
||||||
|
{
|
||||||
|
Super::buildDependencies();
|
||||||
|
if (parent())
|
||||||
|
{
|
||||||
|
parent()->addDependent(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScriptedPathEffect::update(ComponentDirt value)
|
||||||
|
{
|
||||||
|
Super::update(value);
|
||||||
|
|
||||||
|
if (hasDirt(value, ComponentDirt::ScriptUpdate))
|
||||||
|
{
|
||||||
|
invalidateEffectFromLocal();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -61,4 +61,13 @@ void GroupEffect::invalidateEffect(PathProvider* component)
|
|||||||
{
|
{
|
||||||
effect->invalidateEffect(component);
|
effect->invalidateEffect(component);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void GroupEffect::buildDependencies()
|
||||||
|
{
|
||||||
|
Super::buildDependencies();
|
||||||
|
if (parent())
|
||||||
|
{
|
||||||
|
parent()->addDependent(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user