change captions position to not depend on presentation

This commit is contained in:
Ramon Souza 2022-04-13 15:10:40 -03:00
parent bc823b84e0
commit 0b26f066e0
4 changed files with 13 additions and 12 deletions

View File

@ -739,6 +739,7 @@ class CustomLayout extends Component {
.calculatesSidebarNavBounds(sidebarNavWidth.width, sidebarContentWidth.width);
const sidebarContentBounds = this
.calculatesSidebarContentBounds(sidebarNavWidth.width, sidebarContentWidth.width);
const sidebarSize = sidebarContentWidth.width + sidebarNavWidth.width;
const mediaAreaBounds = this
.calculatesMediaAreaBounds(sidebarNavWidth.width, sidebarContentWidth.width);
const navbarBounds = this.calculatesNavbarBounds(mediaAreaBounds);
@ -794,9 +795,9 @@ class CustomLayout extends Component {
layoutContextDispatch({
type: ACTIONS.SET_CAPTIONS_OUTPUT,
value: {
left: !isRTL ? (mediaBounds.left + captionsMargin) : null,
right: isRTL ? (mediaBounds.right + captionsMargin) : null,
maxWidth: mediaBounds.width - (captionsMargin * 2),
left: !isRTL ? (sidebarSize + captionsMargin) : null,
right: isRTL ? (sidebarSize + captionsMargin) : null,
maxWidth: mediaAreaBounds.width - (captionsMargin * 2),
},
});

View File

@ -544,9 +544,9 @@ class PresentationFocusLayout extends Component {
layoutContextDispatch({
type: ACTIONS.SET_CAPTIONS_OUTPUT,
value: {
left: !isRTL ? (mediaBounds.left + captionsMargin) : null,
right: isRTL ? (mediaBounds.right + captionsMargin) : null,
maxWidth: mediaBounds.width - (captionsMargin * 2),
left: !isRTL ? (sidebarSize + captionsMargin) : null,
right: isRTL ? (sidebarSize + captionsMargin) : null,
maxWidth: mediaAreaBounds.width - (captionsMargin * 2),
},
});

View File

@ -590,9 +590,9 @@ class SmartLayout extends Component {
layoutContextDispatch({
type: ACTIONS.SET_CAPTIONS_OUTPUT,
value: {
left: !isRTL ? (mediaBounds.left + captionsMargin) : null,
right: isRTL ? (mediaBounds.right + captionsMargin) : null,
maxWidth: mediaBounds.width - (captionsMargin * 2),
left: !isRTL ? (sidebarSize + captionsMargin) : null,
right: isRTL ? (sidebarSize + captionsMargin) : null,
maxWidth: mediaAreaBounds.width - (captionsMargin * 2),
},
});

View File

@ -556,9 +556,9 @@ class VideoFocusLayout extends Component {
layoutContextDispatch({
type: ACTIONS.SET_CAPTIONS_OUTPUT,
value: {
left: !isRTL ? (mediaBounds.left + captionsMargin) : null,
right: isRTL ? (mediaBounds.right + captionsMargin) : null,
maxWidth: mediaBounds.width - (captionsMargin * 2),
left: !isRTL ? (sidebarSize + captionsMargin) : null,
right: isRTL ? (sidebarSize + captionsMargin) : null,
maxWidth: mediaAreaBounds.width - (captionsMargin * 2),
},
});