@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.js CHANGED
@@ -6082,6 +6082,16 @@ var ThreeDPlugin = class {
6082
6082
  type: "button",
6083
6083
  group: "actions",
6084
6084
  execute: () => instance.download?.()
6085
+ },
6086
+ {
6087
+ id: "open-window",
6088
+ icon: "open-window",
6089
+ label: "Open in Separate Full Window",
6090
+ type: "button",
6091
+ group: "actions",
6092
+ execute: () => {
6093
+ instance.openInSeparateWindow?.();
6094
+ }
6085
6095
  }
6086
6096
  ];
6087
6097
  }
@@ -6152,12 +6162,21 @@ var ThreeDPlugin = class {
6152
6162
  });
6153
6163
  meshGroup.add(obj);
6154
6164
  }
6165
+ const initialBox = new THREE.Box3().setFromObject(meshGroup);
6166
+ const center = initialBox.getCenter(new THREE.Vector3());
6167
+ meshGroup.position.sub(center);
6155
6168
  scene.add(meshGroup);
6156
6169
  const box = new THREE.Box3().setFromObject(meshGroup);
6157
- const sphere = box.getBoundingSphere(new THREE.Sphere());
6158
- const radius = Math.max(sphere.radius, 10);
6170
+ const size = box.getSize(new THREE.Vector3());
6171
+ const maxDim = Math.max(size.x, size.y, size.z) || 10;
6172
+ grid.position.y = -size.y / 2;
6173
+ const gridScale = Math.max(0.1, maxDim / 50);
6174
+ grid.scale.set(gridScale, 1, gridScale);
6175
+ const fovRad = camera.fov * (Math.PI / 180);
6176
+ let cameraDistance = maxDim / 2 / Math.tan(fovRad / 2);
6177
+ cameraDistance = Math.max(cameraDistance * 1.5, 2);
6159
6178
  const fitCamera = () => {
6160
- camera.position.set(radius * 1.5, radius * 1.2, radius * 2);
6179
+ camera.position.set(cameraDistance * 0.8, cameraDistance * 0.6, cameraDistance);
6161
6180
  camera.lookAt(0, 0, 0);
6162
6181
  controls.target.set(0, 0, 0);
6163
6182
  controls.update();
@@ -6203,6 +6222,7 @@ var ThreeDPlugin = class {
6203
6222
  controls.update();
6204
6223
  },
6205
6224
  fitToPage: fitCamera,
6225
+ fitToWidth: fitCamera,
6206
6226
  resetZoom: fitCamera,
6207
6227
  rotateCW: () => {
6208
6228
  isWireframe = !isWireframe;