Skip to content

Commit

Permalink
chore: bump js and use public setters
Browse files Browse the repository at this point in the history
  • Loading branch information
HayesGordon committed Nov 1, 2024
1 parent e6c88c4 commit 15ccb1d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
},
"homepage": "https://github.com/rive-app/rive-react#readme",
"dependencies": {
"@rive-app/canvas": "2.23.0",
"@rive-app/canvas-lite": "2.23.0",
"@rive-app/webgl": "2.23.0",
"@rive-app/webgl2": "2.23.0"
"@rive-app/canvas": "2.23.1",
"@rive-app/canvas-lite": "2.23.1",
"@rive-app/webgl": "2.23.1",
"@rive-app/webgl2": "2.23.1"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
Expand Down
7 changes: 3 additions & 4 deletions src/hooks/useRive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,9 @@ export default function useRive(
if (rive.layout && rive.layout.fit === Fit.Layout) {
if (canvasElem) {
const resizeFactor = devicePixelRatio * rive.layout.layoutScaleFactor;
// TODO (Gordon): expose these are properties on JS runtime
(rive as any)._devicePixelRatioUsed = devicePixelRatio;
(rive as any).artboard.width = canvasElem?.width / resizeFactor;
(rive as any).artboard.height = canvasElem?.height / resizeFactor;
rive.devicePixelRatioUsed = devicePixelRatio;
rive.artboardWidth = canvasElem?.width / resizeFactor;
rive.artboardHeight = canvasElem?.height / resizeFactor;
}
}

Expand Down

0 comments on commit 15ccb1d

Please sign in to comment.