mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-23 09:20:08 +00:00
[bug][datazoom] fix datazoom range error (#221)
This commit is contained in:
@@ -92,13 +92,13 @@ namespace XCharts.Runtime
|
||||
|
||||
if (dataZoom.context.invert)
|
||||
{
|
||||
end = Mathf.CeilToInt(data.Count * dataZoom.end / 100);
|
||||
end = Mathf.RoundToInt(data.Count * dataZoom.end / 100);
|
||||
start = end - range;
|
||||
if (start < 0) start = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
start = Mathf.FloorToInt(data.Count * dataZoom.start / 100);
|
||||
start = Mathf.RoundToInt(data.Count * dataZoom.start / 100);
|
||||
end = start + range;
|
||||
if (end > data.Count) end = data.Count;
|
||||
}
|
||||
@@ -122,8 +122,8 @@ namespace XCharts.Runtime
|
||||
else
|
||||
range = dataZoom.minShowNum;
|
||||
}
|
||||
if (range > data.Count - start - 1)
|
||||
start = data.Count - range - 1;
|
||||
if (range > data.Count - start)
|
||||
start = data.Count - range;
|
||||
if (start >= 0)
|
||||
{
|
||||
dataZoomStartIndex = start;
|
||||
|
||||
Reference in New Issue
Block a user