mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-23 01:10:08 +00:00
增加itemStyle的cornerRadius支持圆角矩形
This commit is contained in:
24
Runtime/Helper/ItemStyleHelper.cs
Normal file
24
Runtime/Helper/ItemStyleHelper.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
/******************************************/
|
||||
/* */
|
||||
/* Copyright (c) 2018 monitor1394 */
|
||||
/* https://github.com/monitor1394 */
|
||||
/* */
|
||||
/******************************************/
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace XCharts
|
||||
{
|
||||
internal static class ItemStyleHelper
|
||||
{
|
||||
public static bool IsNeedCorner(ItemStyle itemStyle)
|
||||
{
|
||||
if (itemStyle.cornerRadius == null) return false;
|
||||
foreach (var value in itemStyle.cornerRadius)
|
||||
{
|
||||
if (value != 0) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Runtime/Helper/ItemStyleHelper.cs.meta
Normal file
11
Runtime/Helper/ItemStyleHelper.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce94468fab72e4b39b53f6cf8b647d6b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -233,5 +233,12 @@ namespace XCharts
|
||||
else if (serie.lineStyle.width != 0) return serie.lineStyle.width;
|
||||
else return 1;
|
||||
}
|
||||
|
||||
public static float[] GetSymbolCornerRadius(Serie serie, SerieData serieData, bool highlight)
|
||||
{
|
||||
var itemStyle = GetItemStyle(serie, serieData, highlight);
|
||||
if(itemStyle != null) return itemStyle.cornerRadius;
|
||||
else return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user