Skip to content

raym3 v1.4.0 - Stable Layout IDs

Latest

Choose a tag to compare

@nanofuxion nanofuxion released this 07 Feb 01:19
· 39 commits to master since this release

🎯 Highlights

  • Fixed layout flicker - Eliminated the 1-frame flicker that occurred when UI structure changed
  • Stable hash-based IDs - Layout node IDs are now based on tree hierarchy, not sequential order
  • New layout API - Added PushId/PopId for advanced manual ID control

🔧 Changes

Layout System Improvements

  • Replaced sequential ID generation with FNV-1a hash-based stable IDs
  • Node IDs remain stable when siblings are added/removed or panels are toggled
  • IDs are now derived from the node's position in the tree hierarchy
  • Changed internal map keys from int to uint32_t for hash storage

New API

// Push/pop explicit IDs for stable layout identity
static void PushId(const char* str_id);
static void PushId(int int_id);
static void PopId();

Bug Fixes

  • Fixed layout flicker during dynamic UI updates
  • Fixed ID shifts when switching tabs or toggling panels
  • Prevented layout position jumps when structure changes

🔄 Backward Compatibility

All existing code continues to work without modifications:

  • SetIdOffset maintains backward compatibility
  • No breaking changes to public API
  • Optional PushId/PopId available for advanced use cases

📝 Technical Details

  • Implemented ID stack infrastructure with child scope management
  • Added FNV-1a hash functions for deterministic ID generation
  • Each container pushes a scope so children hash relative to parent
  • SetIdOffset now integrates with the hash-based system for tab isolation

✅ Testing

  • FoveaEditor builds successfully
  • Layout system functions correctly with no flicker
  • All existing functionality preserved
  • Memory-safe operations verified