ocp-viewer-core 1.0.3 → 1.0.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ocp-viewer-core",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Shared viewer policy for ocp_vscode, ocp_viewer, Jupyter CadQuery and build123d Studio",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/page.js CHANGED
@@ -484,6 +484,17 @@ export function createPage({
484
484
  for (const key of applied) {
485
485
  _config[key] = data.config[key];
486
486
  }
487
+ // Glass and tools decide whether the tree sits over the canvas or
488
+ // beside it, and three-cad-viewer re-lays out with the `cadWidth`
489
+ // it was given: leaving glass mode grows the viewer by `treeWidth`
490
+ // where the canvas should have shrunk by it, so it overflows the
491
+ // pane until something else happens to resize it. The host owns
492
+ // the other two dimensions, so it re-derives all three here, the
493
+ // way a window resize does - `_config` carries the new value by
494
+ // now, which is what `normalizeWidth` reads.
495
+ if (applied.includes("glass") || applied.includes("tools")) {
496
+ resize();
497
+ }
487
498
  } else if (data.type === "animation") {
488
499
  // Explode goes off first: both transform the same objects,
489
500
  // and animating an already-displaced model is wrong.
package/src/version.js CHANGED
@@ -24,4 +24,4 @@
24
24
  limitations under the License.
25
25
  */
26
26
 
27
- export const VERSION = "1.0.3";
27
+ export const VERSION = "1.0.4";