Skip to content

Commit d0000bd

Browse files
Follow up of PR 717. Fix reassignment of cameraSettings (#719)
Fix reassignement of cameraSettings in updateCameraSettings command. Update the labels.
1 parent 492e04b commit d0000bd

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

packages/base/src/commands.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,11 +1058,11 @@ export function addCommands(
10581058

10591059
commands.addCommand(CommandIDs.updateCameraSettings, {
10601060
label: () => {
1061-
const isOn =
1061+
const isPerspectiveOn =
10621062
tracker.currentWidget?.content?.cameraSettings?.type === 'Perspective';
1063-
return isOn
1064-
? trans.__('Perspective projection is on')
1065-
: trans.__('Orthographic projection is on');
1063+
return isPerspectiveOn
1064+
? trans.__('Switch to orthographic projection')
1065+
: trans.__('Switch to perspective projection');
10661066
},
10671067
isEnabled: () => Boolean(tracker.currentWidget),
10681068
icon: videoSolidIcon,
@@ -1077,9 +1077,15 @@ export function addCommands(
10771077
} else {
10781078
const currentSettings: CameraSettings = current.content.cameraSettings;
10791079
if (currentSettings.type === 'Perspective') {
1080-
current.content.cameraSettings.type = 'Orthographic';
1080+
current.content.cameraSettings = {
1081+
...current.content.cameraSettings,
1082+
type: 'Orthographic'
1083+
};
10811084
} else {
1082-
current.content.cameraSettings.type = 'Perspective';
1085+
current.content.cameraSettings = {
1086+
...current.content.cameraSettings,
1087+
type: 'Perspective'
1088+
};
10831089
}
10841090
}
10851091
commands.notifyCommandChanged(CommandIDs.updateCameraSettings);

0 commit comments

Comments
 (0)