Fit.Layout doesn't reflow elements in canvas-lite
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- react, typescript
- Domain
- frontend
Research direction
Reproduce the issue with the supplied useRive example, Fit.Layout, and the same .riv file in @rive-app/react-canvas-lite and @rive-app/react-canvas. Compare how the two runtimes handle layout-constrained elements, then verify that elements pinned to bottom-left remain anchored in canvas-lite while the canvas still fills the viewport.
Written by the indexing model from the issue text.
Description
Title:
Fit.Layout doesn't reflow layout-constrained elements in canvas-lite — elements render at top-left instead of
anchored position
Description:
When using @rive-app/react-canvas-lite with Fit.Layout, elements that use Rive Layout constraints (e.g.
pinned to bottom-left) are not reflowed correctly. They render at the top-left of the canvas instead of their
anchored position. The exact same .riv file works correctly with @rive-app/react-canvas (full runtime).
Environment:
- @rive-app/canvas-lite: 2.35.0 (also reproduced on 2.34.3)
- @rive-app/react-canvas-lite: 4.27.0
- Works correctly with: @rive-app/react-canvas@4.26.2 + @rive-app/canvas@2.34.2
- Browser: Chrome / Safari on macOS
Artboard info (from rive.bounds and rive.layout?.layoutScaleFactor):
layoutScaleFactor: 1
bounds: { minX: 0, minY: 0, maxX: 1512, maxY: 798 }
Canvas at runtime: correctly fills the viewport. The canvas
sizing itself is fine — the bug is purely the position of elements within the canvas.
Code:
const { rive, RiveComponent } = useRive({
src: animationUrl,
stateMachines: 'Training Machine',
layout: new Layout({ fit: Fit.Layout }),
});
return (
<div style={{ position: 'fixed', inset: 0 }}>
<RiveComponent />
</div>
);
Expected: elements pinned to bottom-left via Rive Layout constraints render at the bottom-left of the canvas
(as they do with react-canvas).
Actual: elements render at the top-left of the canvas regardless of their layout constraints.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 58
- Avg merge
- 3h 23m
- Merged PRs (30d)
- 6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rive-app/rive-react
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
rive-app/rive-react#440 · 5 comments · 4 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
rive-app/rive-react#410 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
rive-app/rive-react#400 ·
-
triage
Difficulty 3/5 1-2 days Newbie friendliness 45/100
rive-app/rive-react#392 ·
-
triage
Difficulty 1/5 Under an hour Newbie friendliness 55/100
rive-app/rive-react#386 · 1 reaction ·
All issues in rive-app/rive-react
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
area:tools bug good first issue help wanted priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
TaewoooPark/Motifcode#14 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
newrelic-experimental/preflight#793 · 1 comment ·
-
bug 🐞
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BasedHardware/omi#15320 ·