Files
XCharts/Runtime/Coord/Polar/PolarCoordHandler.cs

37 lines
1.1 KiB
C#
Raw Normal View History

2021-11-23 13:20:07 +08:00
using System;
using UnityEngine;
using UnityEngine.UI;
using XUGL;
2022-02-19 22:37:57 +08:00
namespace XCharts.Runtime
2021-11-23 13:20:07 +08:00
{
[UnityEngine.Scripting.Preserve]
internal sealed class PolarCoordHandler : MainComponentHandler<PolarCoord>
{
public override void Update()
{
PolarHelper.UpdatePolarCenter(component, chart.chartPosition, chart.chartWidth, chart.chartHeight);
2022-01-26 20:47:14 +08:00
if (chart.isPointerInChart)
component.context.isPointerEnter = component.Contains(chart.pointerPos);
else
component.context.isPointerEnter = false;
2021-11-23 13:20:07 +08:00
}
public override void DrawBase(VertexHelper vh)
{
DrawPolar(vh, component);
}
private void DrawPolar(VertexHelper vh, PolarCoord polar)
{
PolarHelper.UpdatePolarCenter(polar, chart.chartPosition, chart.chartWidth, chart.chartHeight);
if (!ChartHelper.IsClearColor(polar.backgroundColor))
{
UGL.DrawCricle(vh, polar.context.center, polar.context.radius, polar.backgroundColor);
}
}
}
}