Xcos ports: fix RoundBlock inputs position 45/17745/1
Clément DAVID [Fri, 29 Jan 2016 07:55:48 +0000 (08:55 +0100)]
Change-Id: I8515f6f2be776a72b9fddb38f020988853c760c0

scilab/modules/xcos/src/java/org/scilab/modules/xcos/block/positionning/RoundBlock.java

index c74eec9..e9b97c3 100644 (file)
@@ -54,7 +54,7 @@ public class RoundBlock extends BasicBlock {
          */
         if (child instanceof InputPort) {
             final InputPort port = (InputPort) child;
-            port.setOrientation(getPortOrientation(index));
+            port.setOrientation(getInputPortOrientation(index));
 
         }
 
@@ -68,28 +68,23 @@ public class RoundBlock extends BasicBlock {
      *            the port ordering
      * @return the selected orientation
      */
-    // CSOFF: MagicNumber
-    private Orientation getPortOrientation(int order) {
+    private Orientation getInputPortOrientation(int order) {
         final Orientation ret;
 
         switch (order) {
-            case 1:
+            case 0:
                 ret = Orientation.SOUTH;
                 break;
-
-            case 2:
+            case 1:
                 ret = Orientation.WEST;
                 break;
-
-            case 3:
+            case 2:
                 ret = Orientation.NORTH;
                 break;
-
             default:
                 ret = Orientation.WEST;
                 break;
         }
         return ret;
     }
-    // CSON: MagicNumber
 }