养成基本完毕,新UI,修bug,装备初步,
This commit is contained in:
@@ -94,13 +94,13 @@ namespace EasyChart
|
||||
var state = label.userData as AppliedState;
|
||||
|
||||
int themeId = theme != null ? theme.GetInstanceID() : 0;
|
||||
UnityEngine.Object fontObj = theme != null ? theme.primaryFont : null;
|
||||
UnityEngine.Object fontObj = ResolveRoleFontObject(theme, role);
|
||||
int fontId = fontObj != null ? fontObj.GetInstanceID() : 0;
|
||||
|
||||
float scale = theme != null ? theme.fontScale : 1f;
|
||||
float roleSizeOverride = ResolveRoleFontSizeOverride(theme, role);
|
||||
float appliedRoleSizeOverride = roleSizeOverride;
|
||||
if (roleSizeOverride >= 0f && HasInlineFontSize(label))
|
||||
if (role != ChartTextRole.Tooltip && roleSizeOverride >= 0f && HasInlineFontSize(label))
|
||||
{
|
||||
appliedRoleSizeOverride = -1f;
|
||||
}
|
||||
@@ -225,6 +225,18 @@ namespace EasyChart
|
||||
}
|
||||
}
|
||||
|
||||
private static UnityEngine.Object ResolveRoleFontObject(ChartTheme theme, ChartTextRole role)
|
||||
{
|
||||
if (theme == null) return null;
|
||||
|
||||
if (role == ChartTextRole.Tooltip && theme.tooltipFont != null)
|
||||
{
|
||||
return theme.tooltipFont;
|
||||
}
|
||||
|
||||
return theme.primaryFont;
|
||||
}
|
||||
|
||||
private static void ApplyFont(Label label, UnityEngine.Object fontObj)
|
||||
{
|
||||
if (label == null) return;
|
||||
|
||||
Reference in New Issue
Block a user