Skip to content

Commit 90f2e76

Browse files
committed
Fix Advanced Module offset reset to zero on parameter refresh
The serialized m_advancedModuleOffset was only applied via the AdvancedModulePosition setter. Three other call sites passed Vector2.zero, so any internal event (state toggles, focus changes, parameter refreshes) would wipe the configured X/Y offset and snap the Advanced Module back to the corner origin. - Add public AdvancedModuleOffset getter on GraphyManager. - Replace Vector2.zero with the serialized offset in: * GraphyManager.SetModulePosition(ModuleType.ADVANCED, ...) * G_AdvancedData.UpdateParameters() * G_AdvancedData.RefreshParameters()
1 parent 1cdf316 commit 90f2e76

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

Runtime/Advanced/G_AdvancedData.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ public void UpdateParameters()
268268
image.color = m_graphyManager.BackgroundColor;
269269
}
270270

271-
SetPosition( m_graphyManager.AdvancedModulePosition, Vector2.zero );
271+
SetPosition( m_graphyManager.AdvancedModulePosition, m_graphyManager.AdvancedModuleOffset );
272272
SetState( m_graphyManager.AdvancedModuleState );
273273
}
274274

@@ -279,7 +279,7 @@ public void RefreshParameters()
279279
image.color = m_graphyManager.BackgroundColor;
280280
}
281281

282-
SetPosition( m_graphyManager.AdvancedModulePosition, Vector2.zero );
282+
SetPosition( m_graphyManager.AdvancedModulePosition, m_graphyManager.AdvancedModuleOffset );
283283
SetState( m_currentModuleState, true );
284284
}
285285

Runtime/GraphyManager.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,8 @@ public ModulePosition AdvancedModulePosition
538538
}
539539
}
540540

541+
public Vector2 AdvancedModuleOffset => m_advancedModuleOffset;
542+
541543
#endregion
542544

543545
#region Methods -> Unity Callbacks
@@ -592,7 +594,7 @@ public void SetModulePosition( ModuleType moduleType, ModulePosition modulePosit
592594
break;
593595

594596
case ModuleType.ADVANCED:
595-
m_advancedData.SetPosition( modulePosition, Vector2.zero );
597+
m_advancedData.SetPosition( modulePosition, m_advancedModuleOffset );
596598
break;
597599
}
598600
}

0 commit comments

Comments
 (0)