Runtime 2.40.0 layout-translation regression

(https://github.com/rive-app/rive-runtime/issues/119)

Hi Rive team — I found a rendering regression between @rive-app/* 2.39.2 and 2.40.0 for Rive 7.3 files.


When an image is nested below a non-artboard LayoutComponent with a stored X/Y translation, 2.40.0 adds that stored translation to the position already solved by the layout engine. In the attached minimal file, the affected image is correctly centered at world X=400 in 2.39.2, but moves to X=494.5 in 2.40.0 — exactly one extra application of the parent layout’s stored X offset of 94.5. A control image outside that nested layout does not move.

The original production file reproduces the same displacement in both WebGL2 and Canvas, so this does not appear renderer-specific. I traced the behavior boundary to runtime commit 2bbd8820878f38398b6ea6e722cb88310588c8e8 (feat: Add support for layout translation offset & compat with all constraints (#13418)), introduced for Rive 7.3 compatibility.

Reproduction

  1. Open the attached .riv file with Web runtime 2.39.2.

  2. Observe the affected nested image aligned to the green guide at world X=400.

  3. Load the same file with Web runtime 2.40.0, without changing the file or fit/alignment.

  4. Observe the affected image at world X=494.5.

  5. Observe that the control image outside the nested layout remains unchanged.

Expected

The authored layout should render identically across the runtime update. The affected image should remain aligned to the guide at world X=400.

Actual

Runtime 2.40.0 moves the affected image to X=494.5, an additional +94.5 px matching the stored X translation of its ancestor LayoutComponent.

Runtime boundary

  • Correct: @rive-app/webgl2 2.39.2 → runtime commit 77804e86 / runtime-v0.1.247

  • Regressed: @rive-app/webgl2 2.40.0 → runtime-v0.1.271

  • Suspected introduction: runtime commit 2bbd8820878f38398b6ea6e722cb88310588c8e8, first released in runtime-v0.1.260

  • Commit subject: feat: Add support for layout translation offset & compat with all constraints (#13418)

Exact C++ path

In runtime-v0.1.271, LayoutComponent::import() enables the new transform behavior for every Rive 7.3+ file:

m_composeTransform = major > 7 || (major == 7 && minor >= 3);

LayoutComponent::buildOwnTransform() then creates an additional translation from the stored node coordinates:

Mat2D::fromTranslation(Vec2D(NodeBase::x(), NodeBase::y()))

LayoutComponent::composeWorldTransform() composes that after the layout engine’s solved translation:

parentWorld × translate(layoutTranslation()) × translate(NodeBase::x/y)

For this repro, the solved layout chain places the image at X=400 and the stored layout X is 94.5, yielding X=494.5 in 2.40.0. Runtime 2.39.2 uses the solved layout position without the added stored offset.

The compatibility problem is the blanket Rive 7.3 gate: a 7.3 file can contain nonzero layout X/Y values written while the prior runtime semantics still ignored them. Runtime 2.40.0 retroactively interprets those existing values as additive offsets. A safe correction likely needs an explicit file feature/version marker or import migration rather than treating every 7.3 file as authored for the new offset semantics.


minimal_repro.riv