mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-06 03:14:00 +00:00
fix: preserve camera controls when rebuilding the Radio panel
This commit is contained in:
1 parent
e1c3045203
commit
1b9ea0e8e3
2 files changed
+16
-1
No files matched your search
@@ -378,6 +378,22 @@ try {
|
|||||||
return rect.width > 0 && rect.left >= 0 && rect.right <= innerWidth + 1;
|
return rect.width > 0 && rect.left >= 0 && rect.right <= innerWidth + 1;
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
check(
|
||||||
|
'rebuilding Radio preserves the active camera controller and subscription',
|
||||||
|
await page.evaluate(() => {
|
||||||
|
const ui = window.__godsEyeView.styleManager;
|
||||||
|
const camera = ui._cctvControls;
|
||||||
|
const cameraId = camera.getState()?.activeCameraId;
|
||||||
|
ui._initRadioPanel();
|
||||||
|
ui._radioControls.connect();
|
||||||
|
return (
|
||||||
|
ui._cctvControls === camera &&
|
||||||
|
!camera.destroyed &&
|
||||||
|
Boolean(camera._cctvUnsubscribe) &&
|
||||||
|
camera.getState()?.activeCameraId === cameraId
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
);
|
||||||
await page.evaluate(() => window.__godsEyeView.styleManager.dispose());
|
await page.evaluate(() => window.__godsEyeView.styleManager.dispose());
|
||||||
check(
|
check(
|
||||||
'CCTV controller is destroyed with the real UI',
|
'CCTV controller is destroyed with the real UI',
|
||||||
|
|||||||
@@ -4885,7 +4885,6 @@ export class StyleManager {
|
|||||||
|
|
||||||
/** Wire the independent Radio companion controls. */
|
/** Wire the independent Radio companion controls. */
|
||||||
_initRadioPanel() {
|
_initRadioPanel() {
|
||||||
this._cctvControls?.destroy();
|
|
||||||
this._radioControls?.destroy();
|
this._radioControls?.destroy();
|
||||||
this._radioControls = new RadioControls({
|
this._radioControls = new RadioControls({
|
||||||
elements: {
|
elements: {
|
||||||
|
|||||||
Reference in new issue
Block a user