海拔图和小地图
This commit is contained in:
1 parent
42fa59d103
commit
8ad36c965d
521 files changed
+1985033
-439
No files matched your search
@@ -0,0 +1,34 @@
|
||||
/************************************************/
|
||||
/* */
|
||||
/* Copyright (c) 2018 - 2021 monitor1394 */
|
||||
/* https://github.com/monitor1394 */
|
||||
/* */
|
||||
/************************************************/
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
namespace XCharts
|
||||
{
|
||||
internal static class PolarHelper
|
||||
{
|
||||
internal static void UpdatePolarCenter(Polar polar, Vector3 chartPosition, float chartWidth, float chartHeight)
|
||||
{
|
||||
if (polar.center.Length < 2) return;
|
||||
var centerX = polar.center[0] <= 1 ? chartWidth * polar.center[0] : polar.center[0];
|
||||
var centerY = polar.center[1] <= 1 ? chartHeight * polar.center[1] : polar.center[1];
|
||||
polar.runtimeCenterPos = chartPosition + new Vector3(centerX, centerY);
|
||||
if (polar.radius <= 0)
|
||||
{
|
||||
polar.runtimeRadius = 0;
|
||||
}
|
||||
else if (polar.radius <= 1)
|
||||
{
|
||||
polar.runtimeRadius = Mathf.Min(chartWidth, chartHeight) * polar.radius;
|
||||
}
|
||||
else
|
||||
{
|
||||
polar.runtimeRadius = polar.radius;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user