Skip to content

Commit 074faf3

Browse files
authored
Fixed maximum call stack exceeds error on measurement jump in MPR with crosshair enabled. (#2519)
1 parent e4b2818 commit 074faf3

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

packages/core/src/RenderingEngine/BaseVolumeViewport.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ abstract class BaseVolumeViewport extends Viewport {
160160

161161
protected applyViewOrientation(
162162
orientation: OrientationAxis | OrientationVectors,
163-
resetCamera = true
163+
resetCamera = true,
164+
suppressEvents = false
164165
) {
165166
const { viewPlaneNormal, viewUp } =
166167
this._getOrientationVectors(orientation) || {};
@@ -178,7 +179,11 @@ abstract class BaseVolumeViewport extends Viewport {
178179

179180
if (resetCamera) {
180181
const t = this as unknown as IVolumeViewport;
181-
t.resetCamera({ resetOrientation: false, resetRotation: false });
182+
t.resetCamera({
183+
resetOrientation: false,
184+
resetRotation: false,
185+
suppressEvents,
186+
});
182187
}
183188
}
184189

@@ -870,7 +875,11 @@ abstract class BaseVolumeViewport extends Viewport {
870875
if (refViewPlaneNormal && !isNegativeNormal && !isSameNormal) {
871876
// Need to update the orientation vectors correctly for this case
872877
// this.setCameraNoEvent({ viewPlaneNormal: refViewPlaneNormal, viewUp });
873-
this.setOrientation({ viewPlaneNormal: refViewPlaneNormal, viewUp });
878+
this.setOrientation(
879+
{ viewPlaneNormal: refViewPlaneNormal, viewUp },
880+
true,
881+
true
882+
);
874883
this.setViewReference(viewRef);
875884
return;
876885
}
@@ -1510,7 +1519,8 @@ abstract class BaseVolumeViewport extends Viewport {
15101519
*/
15111520
public setOrientation(
15121521
_orientation: OrientationAxis | OrientationVectors,
1513-
_immediate = true
1522+
_immediate = true,
1523+
_suppressEvents = false
15141524
): void {
15151525
console.warn('Method "setOrientation" needs implementation');
15161526
}

packages/core/src/RenderingEngine/VolumeViewport.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ class VolumeViewport extends BaseVolumeViewport {
190190
*/
191191
public setOrientation(
192192
orientation: OrientationAxis | OrientationVectors,
193-
immediate = true
193+
immediate = true,
194+
suppressEvents = false
194195
): void {
195196
let viewPlaneNormal, viewUp;
196197

@@ -223,7 +224,7 @@ class VolumeViewport extends BaseVolumeViewport {
223224
this.resetCamera();
224225
} else {
225226
({ viewPlaneNormal, viewUp } = orientation);
226-
this.applyViewOrientation(orientation);
227+
this.applyViewOrientation(orientation, true, suppressEvents);
227228
}
228229

229230
if (immediate) {

0 commit comments

Comments
 (0)