From e8930230e74c3e970afe1603f5763ba0aaa601d8 Mon Sep 17 00:00:00 2001 From: Bruno Alves de Faria Date: Sat, 3 Sep 2016 12:02:28 -0300 Subject: [PATCH] AWV-1: Fixing grid navigation for 1x1 layout --- Packages/ohif-core/client/lib/viewer.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Packages/ohif-core/client/lib/viewer.js b/Packages/ohif-core/client/lib/viewer.js index 55d90356a..6646725aa 100644 --- a/Packages/ohif-core/client/lib/viewer.js +++ b/Packages/ohif-core/client/lib/viewer.js @@ -109,7 +109,8 @@ OHIF.viewer.canMoveDisplaySets = isNext => { const firstIndex = studyViewports[0].displaySetIndex; const steps = studyViewports.length; const amount = study.displaySets.length; - const lastStepIndex = amount - (amount % steps); + const move = (amount % steps) || steps; + const lastStepIndex = amount - move; if (firstIndex + steps !== lastStepIndex + steps) { endReached = false; } @@ -227,7 +228,8 @@ OHIF.viewer.moveMultipleViewportDisplaySets = isNext => { // Check if the indexes are sequenced or will overflow the array bounds if (baseIndex >= amount) { - const lastStepIndex = amount - (amount % steps); + const move = (amount % steps) || steps; + const lastStepIndex = amount - move; if (firstIndex + steps !== lastStepIndex + steps) { // Reset the index if the display sets are sequenced but shifted baseIndex = lastStepIndex;