增加GridLayout网格布局组件

This commit is contained in:
monitor1394
2023-08-29 18:30:11 +08:00
parent e0f6b8c2dc
commit e4fbe5670f
31 changed files with 399 additions and 51 deletions

View File

@@ -83,8 +83,12 @@ namespace XCharts.Runtime
set { if (PropertyUtil.SetStruct(ref m_Height, value)) SetAllDirty(); }
}
public void UpdateRuntimeData(float chartX, float chartY, float chartWidth, float chartHeight)
public void UpdateRuntimeData(BaseChart chart)
{
var chartX = chart.chartX;
var chartY = chart.chartY;
var chartWidth = chart.chartWidth;
var chartHeight = chart.chartHeight;
context.left = left <= 1 ? left * chartWidth : left;
context.bottom = bottom <= 1 ? bottom * chartHeight : bottom;
context.top = top <= 1 ? top * chartHeight : top;

View File

@@ -33,10 +33,7 @@ namespace XCharts.Runtime
axis.painter = chart.painter;
axis.refreshComponent = delegate()
{
axis.UpdateRuntimeData(chart.chartX,
chart.chartY,
chart.chartWidth,
chart.chartHeight);
axis.UpdateRuntimeData(chart);
InitAxis(null,
axis.orient,

View File

@@ -662,8 +662,12 @@ namespace XCharts.Runtime
if (m_EndLabel != null) m_EndLabel.SetPosition(pos);
}
public void UpdateRuntimeData(float chartX, float chartY, float chartWidth, float chartHeight)
public void UpdateRuntimeData(BaseChart chart)
{
var chartX = chart.chartX;
var chartY = chart.chartY;
var chartWidth = chart.chartWidth;
var chartHeight = chart.chartHeight;
var runtimeLeft = left <= 1 ? left * chartWidth : left;
var runtimeBottom = bottom <= 1 ? bottom * chartHeight : bottom;
var runtimeTop = top <= 1 ? top * chartHeight : top;