Açıklama Yok
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PolarCoordHandler.cs 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.UI;
  4. using XUGL;
  5. namespace XCharts.Runtime
  6. {
  7. [UnityEngine.Scripting.Preserve]
  8. internal sealed class PolarCoordHandler : MainComponentHandler<PolarCoord>
  9. {
  10. public override void Update()
  11. {
  12. base.Update();
  13. PolarHelper.UpdatePolarCenter(component, chart.chartPosition, chart.chartWidth, chart.chartHeight);
  14. if (chart.isPointerInChart)
  15. component.context.isPointerEnter = component.Contains(chart.pointerPos);
  16. else
  17. component.context.isPointerEnter = false;
  18. }
  19. public override void DrawBase(VertexHelper vh)
  20. {
  21. DrawPolar(vh, component);
  22. }
  23. private void DrawPolar(VertexHelper vh, PolarCoord polar)
  24. {
  25. PolarHelper.UpdatePolarCenter(polar, chart.chartPosition, chart.chartWidth, chart.chartHeight);
  26. if (polar.show && !ChartHelper.IsClearColor(polar.backgroundColor))
  27. {
  28. if (polar.context.insideRadius > 0)
  29. {
  30. UGL.DrawDoughnut(vh, polar.context.center,
  31. polar.context.insideRadius,
  32. polar.context.outsideRadius,
  33. polar.backgroundColor,
  34. ColorUtil.clearColor32);
  35. }
  36. else
  37. {
  38. UGL.DrawCricle(vh, polar.context.center,
  39. polar.context.outsideRadius,
  40. polar.backgroundColor);
  41. }
  42. }
  43. }
  44. }
  45. }