@opentui/three 0.8.3 → 0.9.0

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.
@@ -20,6 +20,7 @@ export declare class ThreeRenderable extends Renderable {
20
20
  private clearColor;
21
21
  constructor(ctx: RenderContext, options: ThreeRenderableOptions);
22
22
  get aspectRatio(): number;
23
+ set aspectRatio(value: number | null | undefined);
23
24
  get renderer(): ThreeCliRenderer;
24
25
  getScene(): Scene | null;
25
26
  setScene(scene: Scene | null): void;
@@ -33,6 +34,6 @@ export declare class ThreeRenderable extends Renderable {
33
34
  private renderToBuffer;
34
35
  private ensureInitialized;
35
36
  private updateCameraAspect;
36
- private getAspectRatio;
37
+ private computeDisplayAspectRatio;
37
38
  private getRenderSize;
38
39
  }
package/index.js CHANGED
@@ -827,7 +827,10 @@ class ThreeRenderable extends Renderable {
827
827
  this.registerFrameCallback();
828
828
  }
829
829
  get aspectRatio() {
830
- return this.getAspectRatio(this.width, this.height);
830
+ return this.computeDisplayAspectRatio(this.width, this.height);
831
+ }
832
+ set aspectRatio(value) {
833
+ super.aspectRatio = value;
831
834
  }
832
835
  get renderer() {
833
836
  return this.engine;
@@ -926,11 +929,11 @@ class ThreeRenderable extends Renderable {
926
929
  return;
927
930
  const camera = this.engine.getActiveCamera();
928
931
  if (camera instanceof PerspectiveCamera2) {
929
- camera.aspect = this.getAspectRatio(width, height);
932
+ camera.aspect = this.computeDisplayAspectRatio(width, height);
930
933
  camera.updateProjectionMatrix();
931
934
  }
932
935
  }
933
- getAspectRatio(width, height) {
936
+ computeDisplayAspectRatio(width, height) {
934
937
  if (width <= 0 || height <= 0)
935
938
  return 1;
936
939
  const resolution = this.cliRenderer.resolution;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "type": "module",
7
- "version": "0.8.3",
7
+ "version": "0.9.0",
8
8
  "description": "Three.js WebGPU renderer for OpenTUI",
9
9
  "license": "MIT",
10
10
  "repository": {
@@ -28,7 +28,7 @@
28
28
  }
29
29
  },
30
30
  "dependencies": {
31
- "@opentui/core": "0.8.3",
31
+ "@opentui/core": "0.9.0",
32
32
  "jimp": "1.6.1",
33
33
  "three": "0.177.0"
34
34
  },