Fix array misalignment bug in copy/paste functions#56
Open
dagangtj wants to merge 1 commit intoInfiniteSearchSpace:masterfrom
Open
Fix array misalignment bug in copy/paste functions#56dagangtj wants to merge 1 commit intoInfiniteSearchSpace:masterfrom
dagangtj wants to merge 1 commit intoInfiniteSearchSpace:masterfrom
Conversation
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 InfiniteSearchSpace#50
Author
|
Hi, this is a straightforward bug fix. Let me know if you need any changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The copy and paste functions in the editor window were causing array misalignment due to incorrect index order in the for loops.
Root Cause
In
jMenuEditor.java, both the "Copy To Clip" and "Paste From Clip" functions were using[j][i]to access array elements while the loops iterated withias the outer index andjas the inner index.This caused:
Solution
Changed array access from
[j][i]to[i][j]to match the loop iteration order.Lines changed:
TF.pp[j][i].setVal(intAr[j][i][0])→TF.pp[i][j].setVal(intAr[i][j][0])intAr[j][i][0] = TF.pp[j][i].val→intAr[i][j][0] = TF.pp[i][j].valFixes #50