ocp-viewer-core 1.0.0 → 1.0.1
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 +1 -1
- package/src/page.js +13 -1
package/package.json
CHANGED
package/src/page.js
CHANGED
|
@@ -302,7 +302,11 @@ export function createPage({
|
|
|
302
302
|
* function rather than a listener body.
|
|
303
303
|
*/
|
|
304
304
|
function resize() {
|
|
305
|
-
|
|
305
|
+
// `ready` and not only null: clear() returns the viewer to its
|
|
306
|
+
// never-rendered state, where resizeCadView throws - a splitter drag
|
|
307
|
+
// over an emptied pane must not be an error. The next show measures
|
|
308
|
+
// the surface for itself, so a skipped resize here loses nothing.
|
|
309
|
+
if (viewer != null && viewer.ready === true) {
|
|
306
310
|
const displayOptions = getDisplayOptions(_config.theme);
|
|
307
311
|
viewer.resizeCadView(
|
|
308
312
|
displayOptions.cadWidth,
|
|
@@ -399,6 +403,14 @@ export function createPage({
|
|
|
399
403
|
// ever needs to re-render what it already has, that is `showViewer(
|
|
400
404
|
// _meshData, _config)` guarded on `_meshData` being present.
|
|
401
405
|
} else if (data.type === "ui") {
|
|
406
|
+
// Nothing on screen is a normal state now that show_clear exists,
|
|
407
|
+
// and most setters read the rendered scene and throw without one.
|
|
408
|
+
// Said rather than silent: in this ecosystem a dropped config is
|
|
409
|
+
// the hardest thing to debug.
|
|
410
|
+
if (viewer == null || viewer.ready !== true) {
|
|
411
|
+
debugLog("ui: no model on screen, config not applied");
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
402
414
|
if (_config["_splash"]) {
|
|
403
415
|
return;
|
|
404
416
|
}
|