tendon crash fix the current behavior of returning `StatusCode::FailedInversion;` when inversion fails was producing a crash. This was due to the fact that at the artboard level, we don't handle that error code in any specific way. So when a couple of lines later we call `onAddedDirty`, it tries to call `parent()->is<Skin>()`, and since parent() hasn't been set, it crashes. This PR removes that error code and lets the app continue normally to mimic the editor behavior that allows for the inverse to fail, leaving it as an identity matrix. Diffs= a0f076e31 tendon crash fix (#6258) Co-authored-by: hernan <hernan@rive.app>
diff --git a/.rive_head b/.rive_head index 50b6c71..096f99c 100644 --- a/.rive_head +++ b/.rive_head
@@ -1 +1 @@ -fdad661369bfa0092a2de92c02bf106da87977de +a0f076e31824c56cd13ad1cfe58597acdd90314e
diff --git a/src/bones/tendon.cpp b/src/bones/tendon.cpp index 48c8d9d..279b6c2 100644 --- a/src/bones/tendon.cpp +++ b/src/bones/tendon.cpp
@@ -15,10 +15,12 @@ bind[4] = tx(); bind[5] = ty(); - if (!bind.invert(&m_InverseBind)) - { - return StatusCode::FailedInversion; - } + // Internally, this inversion can fail because of a division by 0. + // 'm_InverseBind' will default to an identity matrix. Although + // this can be treated as undefined behavior, the editor lets it go + // through, and nothing really breaks, it just can look odd. So we + // allow the runtime to behave in the same way and return StatusCode::Ok. + bind.invert(&m_InverseBind); StatusCode code = Super::onAddedDirty(context); if (code != StatusCode::Ok)