viral-viewer-2 6.5.5 → 6.5.7

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.
@@ -15,6 +15,7 @@ export declare class ViralCamera {
15
15
  * resize canvas by resize div
16
16
  */
17
17
  resizeCanvas(): void;
18
+ resizeCanvas2(): void;
18
19
  /**
19
20
  * focuse model
20
21
  * @param objectName :model name
package/dist/index.mjs CHANGED
@@ -23233,6 +23233,12 @@ class O2 {
23233
23233
  this.targetElement.clientHeight
23234
23234
  ), this.viralViewerApi.viralRenderer.render());
23235
23235
  }
23236
+ resizeCanvas2() {
23237
+ this.camera && (this.camera.aspect = this.targetElement.offsetWidth / this.targetElement.offsetHeight, this.camera.updateProjectionMatrix(), this.viralViewerApi.viralRenderer.updateSize(
23238
+ this.targetElement.offsetWidth,
23239
+ this.targetElement.offsetHeight
23240
+ ), this.viralViewerApi.viralRenderer.render());
23241
+ }
23236
23242
  /**
23237
23243
  * focuse model
23238
23244
  * @param objectName :model name
@@ -26884,7 +26890,7 @@ class yP {
26884
26890
  //#endregion
26885
26891
  //#region Window
26886
26892
  windowHandler() {
26887
- window.onresize = () => {
26893
+ this.viralViewerApi.targetElement.onresize = () => {
26888
26894
  this.viralViewerApi.viralCamera.resizeCanvas();
26889
26895
  };
26890
26896
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viral-viewer-2",
3
- "version": "6.5.5",
3
+ "version": "6.5.7",
4
4
  "description": "",
5
5
  "main": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",