Fix center orientation reset in picture/supercube mode #407
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.






Fix center orientation reset in picture/supercube mode
Problem
In picture/supercube mode, center stickers would rotate correctly during move animations but reset to their original orientation at the end of the animation. This broke the visual continuity expected in supercube scenarios where center orientations should be preserved.
Root Cause
The issue was in the 3x3x3 KPuzzle definition where
CENTERShadorientationMod: [1, 1, 1, 1, 1, 1]. This caused the orientation calculation(newOrientation) % 1to always result in0, effectively resetting all center orientations after each move.Solution
Changed
orientationModfrom[1, 1, 1, 1, 1, 1]to[4, 4, 4, 4, 4, 4]for theCENTERSorbit. This allows center orientations to be preserved (since centers havenumOrientations: 4) while maintaining mathematical correctness.Impact
Testing
Tested on
experiments.cubing.net/cubing.js/twisty/supercube-arrows.htmlwith moves likeU,R,U2, etc. Center stickers now maintain their final orientation instead of resetting.Fixes the issue introduced in commit 9cdf18f (July 2023) where the optimization for normal cubes conflicted with picture/supercube requirements.