From bf587070cccd344f5e8817e9954ba9f2e46b81bb Mon Sep 17 00:00:00 2001 From: Bez Date: Mon, 20 Jan 2025 21:13:43 +0700 Subject: [PATCH] fix(rotation): support cycling rotateViewportCCW (#4533) --- extensions/cornerstone/src/commandsModule.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/cornerstone/src/commandsModule.ts b/extensions/cornerstone/src/commandsModule.ts index 229281ee2..cc9bee66e 100644 --- a/extensions/cornerstone/src/commandsModule.ts +++ b/extensions/cornerstone/src/commandsModule.ts @@ -569,7 +569,7 @@ function commandsModule({ } else if (viewport.getRotation !== undefined) { const presentation = viewport.getViewPresentation(); const { rotation: currentRotation } = presentation; - const newRotation = (currentRotation + rotation) % 360; + const newRotation = (currentRotation + rotation + 360) % 360; viewport.setViewPresentation({ rotation: newRotation }); viewport.render(); }