Expose build utility (needed for hittesting)
diff --git a/include/rive/shapes/path.hpp b/include/rive/shapes/path.hpp index c20e213..966206b 100644 --- a/include/rive/shapes/path.hpp +++ b/include/rive/shapes/path.hpp
@@ -56,6 +56,9 @@ #ifdef TESTING std::vector<PathVertex*>& vertices() { return m_Vertices; } #endif + + // pour ourselves into a command-path + void buildPath(CommandPath&) const; }; } // namespace rive
diff --git a/src/shapes/path.cpp b/src/shapes/path.cpp index c07803f..e4227f9 100644 --- a/src/shapes/path.cpp +++ b/src/shapes/path.cpp
@@ -42,10 +42,11 @@ const Mat2D& Path::pathTransform() const { return worldTransform(); } -static void buildPath(CommandPath& commandPath, - bool isClosed, - const std::vector<PathVertex*>& vertices) { +void Path::buildPath(CommandPath& commandPath) const { commandPath.reset(); + + const bool isClosed = isPathClosed(); + const std::vector<PathVertex*>& vertices = m_Vertices; auto length = vertices.size(); if (length < 2) { @@ -234,7 +235,7 @@ assert(m_CommandPath != nullptr); if (hasDirt(value, ComponentDirt::Path)) { - buildPath(*m_CommandPath, isPathClosed(), m_Vertices); + buildPath(*m_CommandPath); } // if (hasDirt(value, ComponentDirt::WorldTransform) && m_Shape != nullptr) // {