fix camera position not updating correctly when tab is hidden
This commit is contained in:
parent
3525e0e9d6
commit
a54d10de45
@ -785,8 +785,17 @@ const Whiteboard = React.memo((props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get viewport dimensions and bounds
|
// Get viewport dimensions and bounds
|
||||||
const viewportPageBounds = editor.getViewportPageBounds();
|
let viewportWidth;
|
||||||
const { w: viewportWidth, h: viewportHeight } = viewportPageBounds;
|
let viewportHeight;
|
||||||
|
|
||||||
|
if (isPresenterRef.current) {
|
||||||
|
const viewportPageBounds = editor?.getViewportPageBounds();
|
||||||
|
viewportWidth = viewportPageBounds?.w
|
||||||
|
viewportHeight = viewportPageBounds?.h
|
||||||
|
} else {
|
||||||
|
viewportWidth = currentPresentationPageRef.current?.scaledViewBoxWidth
|
||||||
|
viewportHeight = currentPresentationPageRef.current?.scaledViewBoxHeight
|
||||||
|
}
|
||||||
|
|
||||||
const presentationWidthLocal = currentPresentationPage?.scaledWidth || 0;
|
const presentationWidthLocal = currentPresentationPage?.scaledWidth || 0;
|
||||||
const presentationHeightLocal = currentPresentationPage?.scaledHeight || 0;
|
const presentationHeightLocal = currentPresentationPage?.scaledHeight || 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user