diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/graph.js | 2 | ||||
| -rw-r--r-- | src/views/LandscapeWarning.js | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/graph.js b/src/graph.js index 75491b3..db06a62 100644 --- a/src/graph.js +++ b/src/graph.js @@ -299,6 +299,8 @@ export default function buildGraph({ db, handlers }) { }; const resize = () => { + graph.width(window.innerWidth); + graph.height(window.innerHeight); graph.renderer().setSize(window.innerWidth, window.innerHeight); graph.camera().aspect = window.innerWidth / window.innerHeight; graph.camera().updateProjectionMatrix(); diff --git a/src/views/LandscapeWarning.js b/src/views/LandscapeWarning.js index 389e8a6..1c8e61c 100644 --- a/src/views/LandscapeWarning.js +++ b/src/views/LandscapeWarning.js @@ -27,12 +27,11 @@ const RotateIcon = ( ); export default class LandscapeWarning extends Component { - state = { - landscape: !isMobile || window.innerWidth > window.innerHeight, - }; - constructor(props) { super(props); + this.state = { + landscape: !isMobile || window.innerWidth > window.innerHeight, + }; this.handleResize = this.handleResize.bind(this); if (isMobile) { window.addEventListener("resize", this.handleResize); |
