Fix `SettingsToolboxGroup` allocating excessively due to missing cache validation

This commit is contained in:
Dean Herbert 2024-01-09 18:34:20 +09:00
parent f376bb5ec7
commit 6ac1c799bd
No known key found for this signature in database
1 changed files with 3 additions and 0 deletions

View File

@ -151,9 +151,12 @@ protected override void Update()
base.Update(); base.Update();
if (!headerTextVisibilityCache.IsValid) if (!headerTextVisibilityCache.IsValid)
{
// These toolbox grouped may be contracted to only show icons. // These toolbox grouped may be contracted to only show icons.
// For now, let's hide the header to avoid text truncation weirdness in such cases. // For now, let's hide the header to avoid text truncation weirdness in such cases.
headerText.FadeTo(headerText.DrawWidth < DrawWidth ? 1 : 0, 150, Easing.OutQuint); headerText.FadeTo(headerText.DrawWidth < DrawWidth ? 1 : 0, 150, Easing.OutQuint);
headerTextVisibilityCache.Validate();
}
} }
protected override bool OnInvalidate(Invalidation invalidation, InvalidationSource source) protected override bool OnInvalidate(Invalidation invalidation, InvalidationSource source)