fix: resolve middle slice state sync and zero-step drag freeze
All checks were successful
Deploy to Production / deploy (push) Successful in 6s

This commit is contained in:
2026-02-24 11:37:37 +00:00
parent 8a20531fa0
commit fccc43d0eb
8 changed files with 258 additions and 65 deletions

View File

@@ -47,6 +47,15 @@ export class RubiksJSModel {
this.visual.applyMove(move);
}
rotateSlice(axis, direction, steps = 1) {
// A middle slice rotation (M, E, S) logically translates to rotating
// the two intersecting outer layers in the opposite direction, while
// the centers (the core abstract frame) remain perfectly stationary.
// The frontend simultaneously handles rotating the camera to complete the illusion.
this.rotateLayer(axis, 1, -direction, steps);
this.rotateLayer(axis, -1, -direction, steps);
}
toCubies() {
return this.visual.toCubies();
}