Skip to content

Commit e00e5f2

Browse files
committed
Fixed the error where the frames WERE not moving due to the Layout team's invariant!
Now the frames do move by violating their invariant ONLY if the Clear mode is ON
1 parent 99f8301 commit e00e5f2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/features/cseMachine/CseMachineLayout.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,9 @@ export class Layout {
682682
* @returns coordinate of cached position, or undefined if it doesn't exist
683683
*/
684684
static getGhostFrameX(envId: string): number | undefined {
685+
if (Layout.clearDeadFrames) {
686+
return undefined;
687+
}
685688
const cache = CseMachine.masterLayout;
686689
if (cache && cache.frames.has(envId)) {
687690
const fixedX = cache.frames.get(envId)!;
@@ -702,6 +705,9 @@ export class Layout {
702705
* Reassign x coordinate of every frame to their predetermined position by calling getGhostFrameX.
703706
*/
704707
static applyFixedPositions() {
708+
if (Layout.clearDeadFrames || !CseMachine.masterLayout) {
709+
return;
710+
}
705711
const cache = CseMachine.masterLayout!; // getLayoutPositions() must have been called before
706712
Layout.levels.forEach(level => {
707713
level.frames.forEach(frame => {

0 commit comments

Comments
 (0)