From bd3ff5f57c2fee35e92be4571048cc057eeaf29d Mon Sep 17 00:00:00 2001 From: Patrick Wespi Date: Wed, 23 Jul 2025 18:10:49 +0200 Subject: [PATCH] fix(ViewportOrientationMarkers): round rotation to fix floating point issue (#5135) Co-authored-by: Joe Boccanfuso <109477394+jbocce@users.noreply.github.com> --- .../src/Viewport/Overlays/ViewportOrientationMarkers.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extensions/cornerstone/src/Viewport/Overlays/ViewportOrientationMarkers.tsx b/extensions/cornerstone/src/Viewport/Overlays/ViewportOrientationMarkers.tsx index 3b7179b76..3bf776ed7 100644 --- a/extensions/cornerstone/src/Viewport/Overlays/ViewportOrientationMarkers.tsx +++ b/extensions/cornerstone/src/Viewport/Overlays/ViewportOrientationMarkers.tsx @@ -198,6 +198,9 @@ function _getOrientationMarkers(rowCosines, columnCosines, rotation, flipVertica const oppositeRowString = invertOrientationStringLPS(rowString); const oppositeColumnString = invertOrientationStringLPS(columnString); + // Round to 4 decimal places (after rotate right 3 times and flip horizontally -> rotation is 90.00000000000001) + rotation = Math.round(rotation * 10000) / 10000; + const markers = { top: oppositeColumnString, left: oppositeRowString,