@files-preview-app/preview-file 1.3.11 → 1.3.12

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/angular.cjs CHANGED
@@ -6115,6 +6115,16 @@ var ThreeDPlugin = class {
6115
6115
  type: "button",
6116
6116
  group: "actions",
6117
6117
  execute: () => instance.download?.()
6118
+ },
6119
+ {
6120
+ id: "open-window",
6121
+ icon: "open-window",
6122
+ label: "Open in Separate Full Window",
6123
+ type: "button",
6124
+ group: "actions",
6125
+ execute: () => {
6126
+ instance.openInSeparateWindow?.();
6127
+ }
6118
6128
  }
6119
6129
  ];
6120
6130
  }
@@ -6185,12 +6195,21 @@ var ThreeDPlugin = class {
6185
6195
  });
6186
6196
  meshGroup.add(obj);
6187
6197
  }
6198
+ const initialBox = new THREE__namespace.Box3().setFromObject(meshGroup);
6199
+ const center = initialBox.getCenter(new THREE__namespace.Vector3());
6200
+ meshGroup.position.sub(center);
6188
6201
  scene.add(meshGroup);
6189
6202
  const box = new THREE__namespace.Box3().setFromObject(meshGroup);
6190
- const sphere = box.getBoundingSphere(new THREE__namespace.Sphere());
6191
- const radius = Math.max(sphere.radius, 10);
6203
+ const size = box.getSize(new THREE__namespace.Vector3());
6204
+ const maxDim = Math.max(size.x, size.y, size.z) || 10;
6205
+ grid.position.y = -size.y / 2;
6206
+ const gridScale = Math.max(0.1, maxDim / 50);
6207
+ grid.scale.set(gridScale, 1, gridScale);
6208
+ const fovRad = camera.fov * (Math.PI / 180);
6209
+ let cameraDistance = maxDim / 2 / Math.tan(fovRad / 2);
6210
+ cameraDistance = Math.max(cameraDistance * 1.5, 2);
6192
6211
  const fitCamera = () => {
6193
- camera.position.set(radius * 1.5, radius * 1.2, radius * 2);
6212
+ camera.position.set(cameraDistance * 0.8, cameraDistance * 0.6, cameraDistance);
6194
6213
  camera.lookAt(0, 0, 0);
6195
6214
  controls.target.set(0, 0, 0);
6196
6215
  controls.update();
@@ -6236,6 +6255,7 @@ var ThreeDPlugin = class {
6236
6255
  controls.update();
6237
6256
  },
6238
6257
  fitToPage: fitCamera,
6258
+ fitToWidth: fitCamera,
6239
6259
  resetZoom: fitCamera,
6240
6260
  rotateCW: () => {
6241
6261
  isWireframe = !isWireframe;