@netless/window-manager 1.0.13-test.1 → 1.0.13-test.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/AppListener.ts +1 -1
- package/src/AppManager.ts +1 -1
- package/src/AttributesDelegate.ts +3 -3
- package/src/Utils/RoomHacker.ts +5 -1
- package/src/View/MainView.ts +7 -5
package/package.json
CHANGED
package/src/AppListener.ts
CHANGED
|
@@ -47,7 +47,7 @@ export class AppListeners {
|
|
|
47
47
|
break;
|
|
48
48
|
}
|
|
49
49
|
case Events.SetMainViewScenePath: {
|
|
50
|
-
console.log("[window-manager] mainMagixEventListener====>", data.payload);
|
|
50
|
+
console.log("[window-manager] mainMagixEventListener====>", JSON.stringify(data.payload));
|
|
51
51
|
this.setMainViewScenePathHandler(data.payload);
|
|
52
52
|
break;
|
|
53
53
|
}
|
package/src/AppManager.ts
CHANGED
|
@@ -897,7 +897,7 @@ export class AppManager {
|
|
|
897
897
|
}
|
|
898
898
|
|
|
899
899
|
private dispatchSetMainViewScenePath(scenePath: string): void {
|
|
900
|
-
console.log("[window-manager] dispatchSetMainViewScenePath====>", scenePath);
|
|
900
|
+
console.log("[window-manager] dispatchSetMainViewScenePath====>", JSON.stringify(scenePath));
|
|
901
901
|
this.dispatchInternalEvent(Events.SetMainViewScenePath, { nextScenePath: scenePath });
|
|
902
902
|
callbacks.emit("mainViewScenePathChange", scenePath);
|
|
903
903
|
// 兼容 15 的 SDK, 需要 room 的当前 ScenePath
|
|
@@ -212,19 +212,19 @@ export class AttributesDelegate {
|
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
public setMainViewCamera(camera: ICamera) {
|
|
215
|
-
console.log("[window-manager] setMainViewCamera", camera);
|
|
215
|
+
console.log("[window-manager] setMainViewCamera====>", JSON.stringify(camera));
|
|
216
216
|
this.context.safeSetAttributes({ [Fields.MainViewCamera]: { ...camera } });
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
public setMainViewSize(size: ISize) {
|
|
220
220
|
if (size.width === 0 || size.height === 0) return;
|
|
221
|
-
console.log("[window-manager] setMainViewSize", size);
|
|
221
|
+
console.log("[window-manager] setMainViewSize====>", JSON.stringify(size));
|
|
222
222
|
this.context.safeSetAttributes({ [Fields.MainViewSize]: { ...size } });
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
public setMainViewCameraAndSize(camera: ICamera, size: ISize) {
|
|
226
226
|
if (size.width === 0 || size.height === 0) return;
|
|
227
|
-
console.log("[window-manager] setMainViewCameraAndSize", camera, size);
|
|
227
|
+
console.log("[window-manager] setMainViewCameraAndSize====>", JSON.stringify(camera), JSON.stringify(size));
|
|
228
228
|
this.context.safeSetAttributes({
|
|
229
229
|
[Fields.MainViewCamera]: { ...camera },
|
|
230
230
|
[Fields.MainViewSize]: { ...size },
|
package/src/Utils/RoomHacker.ts
CHANGED
|
@@ -33,7 +33,11 @@ export const replaceRoomFunction = (room: Room | Player, manager: WindowManager)
|
|
|
33
33
|
return manager.canRedoSteps;
|
|
34
34
|
},
|
|
35
35
|
});
|
|
36
|
-
|
|
36
|
+
const _scalePptToFit = room.scalePptToFit;
|
|
37
|
+
room.scalePptToFit = (...args) => {
|
|
38
|
+
console.log("[window-manager] scalePptToFit====>", JSON.stringify(args));
|
|
39
|
+
_scalePptToFit.call(room, ...args);
|
|
40
|
+
};
|
|
37
41
|
room.moveCamera = (camera: Camera) => manager.moveCamera(camera);
|
|
38
42
|
room.moveCameraToContain = (...args) => manager.moveCameraToContain(...args);
|
|
39
43
|
room.convertToPointInWorld = (...args) => manager.mainView.convertToPointInWorld(...args);
|
package/src/View/MainView.ts
CHANGED
|
@@ -33,7 +33,7 @@ export class MainViewProxy {
|
|
|
33
33
|
this.startListenWritableChange();
|
|
34
34
|
});
|
|
35
35
|
const playgroundSizeChangeListener = () => {
|
|
36
|
-
console.log("[window-manager] playgroundSizeChangeListener====>", this.mainViewSize);
|
|
36
|
+
console.log("[window-manager] playgroundSizeChangeListener====>", JSON.stringify(this.mainViewSize));
|
|
37
37
|
this.sizeChangeHandler(this.mainViewSize);
|
|
38
38
|
};
|
|
39
39
|
this.sideEffectManager.add(() => {
|
|
@@ -98,7 +98,7 @@ export class MainViewProxy {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
public start() {
|
|
101
|
-
console.log("[window-manager] start====>", this.mainViewSize);
|
|
101
|
+
console.log("[window-manager] start====>", JSON.stringify(this.mainViewSize));
|
|
102
102
|
this.sizeChangeHandler(this.mainViewSize);
|
|
103
103
|
if (this.started) return;
|
|
104
104
|
this.addCameraListener();
|
|
@@ -122,7 +122,7 @@ export class MainViewProxy {
|
|
|
122
122
|
() => this.mainViewCamera,
|
|
123
123
|
camera => {
|
|
124
124
|
if (camera && camera.id !== this.manager.uid) {
|
|
125
|
-
console.log("[window-manager] cameraReaction====>", camera, this.mainViewSize);
|
|
125
|
+
console.log("[window-manager] cameraReaction====>", JSON.stringify(camera), JSON.stringify(this.mainViewSize));
|
|
126
126
|
this.moveCameraToContian(this.mainViewSize);
|
|
127
127
|
this.moveCamera(camera);
|
|
128
128
|
}
|
|
@@ -133,16 +133,16 @@ export class MainViewProxy {
|
|
|
133
133
|
|
|
134
134
|
public sizeChangeHandler = debounce((size: Size) => {
|
|
135
135
|
if (size) {
|
|
136
|
-
console.log("[window-manager] sizeChangeHandler====>", size, this.mainViewCamera);
|
|
137
136
|
this.moveCameraToContian(size);
|
|
138
137
|
this.moveCamera(this.mainViewCamera);
|
|
138
|
+
console.log("[window-manager] sizeChangeHandler====> current size and camera", JSON.stringify(size), JSON.stringify(this.mainViewCamera));
|
|
139
139
|
}
|
|
140
140
|
this.ensureMainViewSize();
|
|
141
141
|
}, 30);
|
|
142
142
|
|
|
143
143
|
public onUpdateContainerSizeRatio = () => {
|
|
144
144
|
const size = this.store.getMainViewSize();
|
|
145
|
-
console.log("[window-manager] onUpdateContainerSizeRatio====>", size);
|
|
145
|
+
console.log("[window-manager] onUpdateContainerSizeRatio====>", JSON.stringify(size));
|
|
146
146
|
this.sizeChangeHandler(size);
|
|
147
147
|
};
|
|
148
148
|
|
|
@@ -254,6 +254,7 @@ export class MainViewProxy {
|
|
|
254
254
|
clearTimeout(this._syncMainViewTimer);
|
|
255
255
|
this._syncMainViewTimer = setTimeout(this.syncMainView, 100, this.manager.room);
|
|
256
256
|
}
|
|
257
|
+
console.log("[window-manager] onCameraOrSizeUpdated====>", JSON.stringify(this.cameraState));
|
|
257
258
|
this.ensureMainViewSize();
|
|
258
259
|
};
|
|
259
260
|
|
|
@@ -271,6 +272,7 @@ export class MainViewProxy {
|
|
|
271
272
|
|
|
272
273
|
private syncMainView = (room: Room) => {
|
|
273
274
|
if (room.isWritable) {
|
|
275
|
+
console.log("[window-manager] syncMainView====>");
|
|
274
276
|
room.syncMainView(this.mainView);
|
|
275
277
|
}
|
|
276
278
|
};
|