修复GridCoord在设置背景色且Serie开启Clip时会覆盖图表的问题

This commit is contained in:
monitor1394
2025-04-07 11:16:33 +08:00
parent eafd7276c0
commit b23c581b63
2 changed files with 9 additions and 2 deletions

View File

@@ -80,6 +80,7 @@ slug: /changelog
## master
* (2025.04.07) 修复`GridCoord`在设置背景色且Serie开启Clip时会覆盖图表的问题
* (2025.04.07) 修复`Gantt`甘特图年份大于2038时显示异常的问题
* (2025.04.07) 修复`Axis``Time`时间轴无法显示大于2038的年份的问题
* (2025.04.06) 修复`Axis``Time`时间轴在有`DataZoom`缩放时文本显示异常的问题

View File

@@ -12,7 +12,7 @@ namespace XCharts.Runtime
{
var grid = component;
grid.painter = chart.painter;
grid.refreshComponent = delegate()
grid.refreshComponent = delegate ()
{
grid.UpdateRuntimeData(chart);
chart.OnCoordinateChanged();
@@ -51,6 +51,7 @@ namespace XCharts.Runtime
public override void DrawBase(VertexHelper vh)
{
DrawBackground(vh, component);
if (!SeriesHelper.IsAnyClipSerie(chart.series))
{
DrawCoord(vh, component);
@@ -64,7 +65,7 @@ namespace XCharts.Runtime
}
}
private void DrawCoord(VertexHelper vh, GridCoord grid)
private void DrawBackground(VertexHelper vh, GridCoord grid)
{
if (!grid.show) return;
if (!ChartHelper.IsClearColor(grid.backgroundColor))
@@ -75,6 +76,11 @@ namespace XCharts.Runtime
var p4 = new Vector2(grid.context.x + grid.context.width, grid.context.y);
UGL.DrawQuadrilateral(vh, p1, p2, p3, p4, grid.backgroundColor);
}
}
private void DrawCoord(VertexHelper vh, GridCoord grid)
{
if (!grid.show) return;
if (grid.showBorder)
{
var borderWidth = grid.borderWidth == 0 ? chart.theme.axis.lineWidth * 2 : grid.borderWidth;