mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 21:27:21 +01:00
fix cache dict wtf
This commit is contained in:
parent
e65c363d0f
commit
11bb84bd61
1 changed files with 3 additions and 5 deletions
|
|
@ -18,9 +18,7 @@ using MareSynchronos.Services;
|
|||
using MareSynchronos.Services.Mediator;
|
||||
using MareSynchronos.Services.ServerConfiguration;
|
||||
using MareSynchronos.WebAPI;
|
||||
using MareSynchronos.WebAPI.SignalR.Utils;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Globalization;
|
||||
using System.Numerics;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
|
@ -445,14 +443,14 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
|
|||
|
||||
public static Vector2 GetNormalizedIconSize(FontAwesomeIcon icon)
|
||||
{
|
||||
if (_iconCacheDict.TryGetValue(ImGuiHelpers.GlobalScale, out var iconCache))
|
||||
if (_normalizedIconScales.TryGetValue(ImGuiHelpers.GlobalScale, out var iconCache))
|
||||
{
|
||||
if (iconCache.TryGetValue(icon, out var size)) return size;
|
||||
return iconCache[icon] = CalcIconScale(icon);
|
||||
}
|
||||
|
||||
_iconCacheDict.Add(ImGuiHelpers.GlobalScale, new());
|
||||
return _iconCacheDict[ImGuiHelpers.GlobalScale][icon] = CalcIconScale(icon);
|
||||
_normalizedIconScales.Add(ImGuiHelpers.GlobalScale, new());
|
||||
return _normalizedIconScales[ImGuiHelpers.GlobalScale][icon] = CalcIconScale(icon);
|
||||
}
|
||||
|
||||
public static void NormalizedIcon(FontAwesomeIcon icon, Vector4? color = null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue