Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit 4ab0e0e

Browse files
authored
Surface display width and height in stage context
1 parent 25cf0b7 commit 4ab0e0e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/stage.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ export default class Stage extends Component {
2121
static childContextTypes = {
2222
loop: PropTypes.object,
2323
scale: PropTypes.number,
24+
renderWidth: PropTypes.number,
25+
renderHeight: PropTypes.number,
2426
};
2527

2628
setDimensions = () => {
@@ -52,8 +54,11 @@ export default class Stage extends Component {
5254
}
5355

5456
getChildContext() {
57+
const { scale, width, height } = this.getScale();
5558
return {
56-
scale: this.getScale().scale,
59+
scale: scale,
60+
renderWidth: width,
61+
renderHeight: height,
5762
loop: this.context.loop,
5863
};
5964
}

0 commit comments

Comments
 (0)