diff --git a/bigbluebutton-html5/imports/ui/components/app/component.jsx b/bigbluebutton-html5/imports/ui/components/app/component.jsx index 9e90a61982..1ce67d78fb 100644 --- a/bigbluebutton-html5/imports/ui/components/app/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/app/component.jsx @@ -629,7 +629,6 @@ class App extends Component { - {shouldShowPresentation ? : null} {shouldShowScreenshare ? : null} diff --git a/bigbluebutton-html5/imports/ui/components/app/styles.js b/bigbluebutton-html5/imports/ui/components/app/styles.js index 993587712d..7c1caf39e7 100644 --- a/bigbluebutton-html5/imports/ui/components/app/styles.js +++ b/bigbluebutton-html5/imports/ui/components/app/styles.js @@ -68,25 +68,6 @@ const DtfImages = ` svg `; -const TextMeasure = styled.pre` - white-space: pre; - width: auto; - border: 1px solid red; - padding: 4px; - margin: 0px; - letter-spacing: -0.03em; - opacity: 0; - position: absolute; - top: -500px; - left: 0px; - z-index: 9999; - pointer-events: none; - user-select: none; - alignment-baseline: mathematical; - dominant-baseline: mathematical; - font-family: "Source Code Pro"; -`; - export default { CaptionsWrapper, ActionsBar, @@ -94,5 +75,4 @@ export default { DtfInvert, DtfCss, DtfImages, - TextMeasure, }; diff --git a/bigbluebutton-html5/imports/ui/components/whiteboard/utils.js b/bigbluebutton-html5/imports/ui/components/whiteboard/utils.js index ca2965bf3b..97cfb93fb0 100644 --- a/bigbluebutton-html5/imports/ui/components/whiteboard/utils.js +++ b/bigbluebutton-html5/imports/ui/components/whiteboard/utils.js @@ -100,67 +100,11 @@ const mapLanguage = (language) => { } }; -/* getFontStyle adapted from tldraw source code - https://github.com/tldraw/tldraw/blob/55a8831a6b036faae0dfd77d6733a8f585f5ae23/packages/tldraw/src/state/shapes/shared/shape-styles.ts#L123 */ -const getFontStyle = (style) => { - const fontSizes = { - small: 28, - medium: 48, - large: 96, - auto: 'auto', - }; - - const fontFaces = { - script: '"Caveat Brush"', - sans: '"Source Sans Pro"', - serif: '"Crimson Pro"', - mono: '"Source Code Pro"', - } - - const fontSize = fontSizes[style.size]; - const fontFace = fontFaces[style.font]; - const { scale = 1 } = style; - - return `${fontSize * scale}px/1 ${fontFace}`; -} - -/* getMeasurementDiv and getTextSize adapted from tldraw source code - https://github.com/tldraw/tldraw/blob/55a8831a6b036faae0dfd77d6733a8f585f5ae23/packages/tldraw/src/state/shapes/shared/getTextSize.ts */ -const getMeasurementDiv = (font) => { - // A div used for measurement - const pre = document.getElementById('text-measure'); - pre.style.font = font; - - return pre; -} - -const getTextSize = (text, style, padding) => { - const font = getFontStyle(style); - - if (!text) { - return [16, 32]; - } - - const melm = getMeasurementDiv(font); - melm.textContent = text; - - if (!melm) { - // We're in SSR - return [10, 10]; - } - - // In tests, offsetWidth and offsetHeight will be 0 - const width = melm.offsetWidth || 1; - const height = melm.offsetHeight || 1; - - return [width + padding, height + padding]; -}; - const Utils = { - usePrevious, findRemoved, filterInvalidShapes, mapLanguage, getTextSize, + usePrevious, findRemoved, filterInvalidShapes, mapLanguage, }; export default Utils; export { - usePrevious, findRemoved, filterInvalidShapes, mapLanguage, getTextSize, + usePrevious, findRemoved, filterInvalidShapes, mapLanguage, };