Propagate collapse to path composer.
Fixes crash caught by @zplata discussed here: https://2dimensions.slack.com/archives/CLLCU09T6/p1681424342445369?thread_ts=1681320431.308629&cid=CLLCU09T6
We weren't propagating collapse to the path composer which meant that when the collapse for solo changed the deferred dirt (from the GameKit optimization of not updating opacity 0 paths) we wouldn't run the update cycle on the path composer. This meant no path would ever get generated for some shapes.
Diffs=
abc600932 Propagate collapse to path composer. (#5116)
diff --git a/.rive_head b/.rive_head
index 6ae37bf..03e19ad 100644
--- a/.rive_head
+++ b/.rive_head
@@ -1 +1 @@
-9266e0d308fa635b6cd9e037fa75c7b88cdb7a87
+abc600932de98bb9552585370faa27b57d96b7db
diff --git a/include/rive/shapes/shape.hpp b/include/rive/shapes/shape.hpp
index ef420cf..9c236eb 100644
--- a/include/rive/shapes/shape.hpp
+++ b/include/rive/shapes/shape.hpp
@@ -25,6 +25,7 @@
public:
Shape();
void buildDependencies() override;
+ bool collapse(bool value) override;
void addPath(Path* path);
std::vector<Path*>& paths() { return m_Paths; }
diff --git a/src/shapes/shape.cpp b/src/shapes/shape.cpp
index c7270fa..9e4e8b1 100644
--- a/src/shapes/shape.cpp
+++ b/src/shapes/shape.cpp
@@ -28,6 +28,16 @@
}
}
+bool Shape::collapse(bool value)
+{
+ if (!Super::collapse(value))
+ {
+ return false;
+ }
+ m_PathComposer.collapse(value);
+ return true;
+}
+
void Shape::pathChanged()
{
m_PathComposer.addDirt(ComponentDirt::Path, true);