@itwin/saved-views-react 1.2.4 → 1.2.5

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.
@@ -26,9 +26,16 @@ function applyCameraOptions(seedViewStateProps, _iModel, viewport, savedViewData
26
26
  viewDef.angles = YawPitchRollAngles.createFromMatrix3d(cameraProps.rotation)?.toJSON();
27
27
  viewDef.camera = cameraProps.camera;
28
28
  }
29
- else {
29
+ else if (!(cameraProps instanceof ViewPose)) {
30
30
  const cameraProps3d = cameraProps;
31
- viewDef.cameraOn = cameraProps3d.camera !== undefined;
31
+ // cameraOn property only exists on ViewDefinitionProps (from viewport),
32
+ // not on ViewData/ViewITwin3d. For saved view data, infer from camera presence.
33
+ if (settings.camera === "keep") {
34
+ viewDef.cameraOn = cameraProps.cameraOn ?? false;
35
+ }
36
+ else {
37
+ viewDef.cameraOn = cameraProps3d.camera !== undefined;
38
+ }
32
39
  viewDef.origin = cameraProps3d.origin;
33
40
  viewDef.extents = cameraProps3d.extents;
34
41
  viewDef.angles = cameraProps3d.angles;
@@ -82,7 +89,7 @@ async function applyViewStateProps(viewStateProps, iModel, viewport, savedViewDa
82
89
  });
83
90
  viewport.changeView(viewState, settings.viewChangeOptions);
84
91
  if (settings.subcategories !== "ignore") {
85
- // If subcategories are not ignored, we need to reset them here,
92
+ // If subcategories are not ignored, we need to reset them here,
86
93
  // otherwise we might end up with subcategories not shown correctly
87
94
  const { addCategories, dropCategories } = await sortCategories(iModel, savedViewData.viewData, categories);
88
95
  viewport.changeCategoryDisplay(dropCategories, false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/saved-views-react",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -66,7 +66,7 @@
66
66
  "@itwin/itwinui-icons-react": "^2.9.0",
67
67
  "@itwin/itwinui-react": "^3.15.0",
68
68
  "fuse.js": "^6.6.2",
69
- "@itwin/saved-views-client": "^0.6.2"
69
+ "@itwin/saved-views-client": "^0.6.3"
70
70
  },
71
71
  "scripts": {
72
72
  "build": "run-p build:*",