Merge pull request #16169 from JoVictorNunes/issue-16140
feat(whiteboard): reset zoom when switching presentation
This commit is contained in:
commit
9184a16690
@ -452,6 +452,14 @@ export default function Whiteboard(props) {
|
||||
tldrawAPI?.setSetting('language', language);
|
||||
}, [language]);
|
||||
|
||||
// Reset zoom to default when current presentation changes.
|
||||
React.useEffect(() => {
|
||||
if (isPresenter && slidePosition && tldrawAPI) {
|
||||
const zoom = calculateZoom(slidePosition.width, slidePosition.height);
|
||||
tldrawAPI.zoomTo(zoom);
|
||||
}
|
||||
}, [curPres?.id]);
|
||||
|
||||
const onMount = (app) => {
|
||||
const menu = document.getElementById("TD-Styles")?.parentElement;
|
||||
if (menu) {
|
||||
|
Loading…
Reference in New Issue
Block a user