mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-21 00:59:29 +00:00
Fix fullscreen mode
This commit is contained in:
parent
a571387780
commit
7f7ac09db4
1 changed files with 8 additions and 5 deletions
|
|
@ -80,9 +80,15 @@ class PresetsLoader extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
_renderMilkdrop({ width, height }) {
|
||||
_renderMilkdrop(size) {
|
||||
const { butterchurn, presets } = this.state;
|
||||
const loaded = butterchurn != null && presets != null;
|
||||
const { width, height } = this.state.isFullscreen
|
||||
? { width: screen.width, height: screen.height }
|
||||
: size;
|
||||
// Note: This _wrapperNode must not be removed from the DOM while
|
||||
// in/entering full screen mode. Ensure `this.setState({isFullscreen})`
|
||||
// does not cause this node to change identity.
|
||||
return (
|
||||
<Background innerRef={node => (this._wrapperNode = node)}>
|
||||
{loaded && (
|
||||
|
|
@ -100,10 +106,7 @@ class PresetsLoader extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
if (this.state.isFullscreen) {
|
||||
const size = { width: screen.width, height: screen.height };
|
||||
return this._renderMilkdrop(size);
|
||||
} else if (this.state.desktop) {
|
||||
if (this.state.desktop) {
|
||||
const size = { width: window.innerWidth, height: window.innerHeight };
|
||||
return (
|
||||
<ContextMenuWrapper
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue