From 84baa6c1fa5ba0ef0200cc83ab4c0ad830d1fa32 Mon Sep 17 00:00:00 2001 From: dagangtj <2285648311@qq.com> Date: Fri, 27 Feb 2026 07:46:40 +1100 Subject: [PATCH] Fix array misalignment bug in copy/paste functions Fixed index order in jMenuEditor.java copy and paste operations. Changed from [j][i] to [i][j] to match loop iteration order. This resolves the issue where: - Leftmost column was wrapped to rightmost column (grid shift by -1,0) - Rightmost column was then shifted by (0,-1) Fixes #50 --- CellularAutomata/Omniscience/src/jMenuEditor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CellularAutomata/Omniscience/src/jMenuEditor.java b/CellularAutomata/Omniscience/src/jMenuEditor.java index 7abb543..9f69804 100644 --- a/CellularAutomata/Omniscience/src/jMenuEditor.java +++ b/CellularAutomata/Omniscience/src/jMenuEditor.java @@ -74,7 +74,7 @@ public void actionPerformed(ActionEvent e) { int[][][] intAr = ML.d.getArray(); for(int i = 0; i < TF.pp.length; i++){ for(int j = 0; j < TF.pp[i].length; j++){ - TF.pp[j][i].setVal(intAr[j][i][0]); + TF.pp[i][j].setVal(intAr[i][j][0]); } } @@ -89,7 +89,7 @@ public void actionPerformed(ActionEvent e) { int[][][] intAr = new int[TF.pp.length][TF.pp[0].length][1]; for(int i = 0; i < TF.pp.length; i++){ for(int j = 0; j < TF.pp[i].length; j++){ - intAr[j][i][0] = TF.pp[j][i].val; + intAr[i][j][0] = TF.pp[i][j].val; } }