增加Tooltip通过TitleLabelStyleTextStyleAlignment设置标题的对齐方式 (#363)

This commit is contained in:
monitor1394
2026-06-03 22:03:06 +08:00
parent 12be0ef93b
commit 986fe7e575
3 changed files with 3 additions and 1 deletions

View File

@@ -155,7 +155,7 @@ namespace XCharts.Runtime
[SerializeField]
private List<LabelStyle> m_ContentLabelStyles = new List<LabelStyle>()
{
new LabelStyle() { textPadding = new TextPadding(0, 5, 0, 0), textStyle = new TextStyle() { alignment = TextAnchor.MiddleCenter } },
new LabelStyle() { textPadding = new TextPadding(0, 5, 0, 0), textStyle = new TextStyle() { alignment = TextAnchor.MiddleLeft } },
new LabelStyle() { textPadding = new TextPadding(0, 20, 0, 0), textStyle = new TextStyle() { alignment = TextAnchor.MiddleLeft } },
new LabelStyle() { textPadding = new TextPadding(0, 0, 0, 0), textStyle = new TextStyle() { alignment = TextAnchor.MiddleRight } }
};

View File

@@ -260,6 +260,7 @@ namespace XCharts.Runtime
view.layout.childControlWidth = false;
view.layout.childForceExpandHeight = false;
view.layout.childForceExpandWidth = false;
view.layout.childAlignment = tooltip.titleLabelStyle.textStyle.alignment;
view.layout.padding = new RectOffset(tooltip.paddingLeftRight,
tooltip.paddingLeftRight,
tooltip.paddingTopBottom,