增加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

@@ -92,8 +92,12 @@ namespace XCharts.Runtime
return context.runtimeIsPointerEnter;
}
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

@@ -20,7 +20,7 @@ namespace XCharts.Runtime
grid.painter = chart.painter;
grid.refreshComponent = delegate()
{
grid.UpdateRuntimeData(chart.chartX, chart.chartY, chart.chartWidth, chart.chartHeight);
grid.UpdateRuntimeData(chart);
chart.OnCoordinateChanged();
};
grid.refreshComponent();