diff --git a/build/build-windows.ps1 b/build/build-windows.ps1 index d2cdda589..b9d7280f5 100644 --- a/build/build-windows.ps1 +++ b/build/build-windows.ps1 @@ -1,17 +1,22 @@ param([string]$configuration = "Release") +dotnet workload install macos +dotnet workload install ios +dotnet workload install maccatalyst +dotnet workload install android + dotnet build ./src/skiasharp/LiveChartsCore.SkiaSharp.Avalonia/LiveChartsCore.SkiaSharpView.Avalonia.csproj -c $configuration dotnet build ./src/skiasharp/LiveChartsCore.SkiaSharp.WinForms/LiveChartsCore.SkiaSharpView.WinForms.csproj -c $configuration dotnet build ./src/skiasharp/LiveChartsCore.SkiaSharp.Wpf/LiveChartsCore.SkiaSharpView.Wpf.csproj -c $configuration dotnet build ./src/skiasharp/LiveChartsCore.SkiaSharp.Xamarin.Forms/LiveChartsCore.SkiaSharpView.Xamarin.Forms.csproj -c $configuration dotnet build ./src/skiasharp/LiveChartsCore.SkiaSharpView.Blazor/LiveChartsCore.SkiaSharpView.Blazor.csproj -c $configuration dotnet build ./src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsCore.SkiaSharpView.Eto.csproj -c $configuration +dotnet build ./src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsCore.SkiaSharpView.Maui.csproj -c $configuration +# DISABLE DOTNET BUILD FOR NOW # LiveCharts requires VisualStudio 17.8 -# but it seems that the current image installed is 17.6 -# for now we are skiping msbuilds - -# dotnet build ./src/skiasharp/LiveChartsCore.SkiaSharpView.Maui/LiveChartsCore.SkiaSharpView.Maui.csproj -c $configuration +# but it seems that the current image installed is 17.6 (UPDATE NOT SURE WHICH VERSION IS INSTALLED AS TODAY) +# FOR NOW... DISABLE MSBUILD # $msbuild = &"${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -prerelease -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe @@ -23,4 +28,4 @@ dotnet build ./src/skiasharp/LiveChartsCore.SkiaSharpView.Eto/LiveChartsCore.Ski # & $msbuild ` # ./src/skiasharp/LiveChartsCore.SkiaSharpView.Uno.WinUI/LiveChartsCore.SkiaSharpView.Uno.WinUI.csproj ` # /p:configuration=$configuration ` -# /restore +# /restore \ No newline at end of file diff --git a/src/LiveChartsCore/CoreAxis.cs b/src/LiveChartsCore/CoreAxis.cs index 10a14170e..5d37b7ed5 100644 --- a/src/LiveChartsCore/CoreAxis.cs +++ b/src/LiveChartsCore/CoreAxis.cs @@ -102,7 +102,6 @@ public abstract class CoreAxis private Align? _labelsAlignment; private bool _inLineNamePlacement; private IEnumerable? _customSeparators; - private int _stepCount; internal double? _logBase; #endregion @@ -307,8 +306,6 @@ public LvcColor? CrosshairLabelsBackground /// public override void Invalidate(Chart chart) { - _stepCount = 0; - var cartesianChart = (CartesianChart)chart; var controlSize = cartesianChart.ControlSize; @@ -607,8 +604,6 @@ NamePadding is not null || SeparatorsPaint is not null || LabelsPaint is not nul UpdateLabel(visualSeparator.Label, x, y + tyco, labelContent, hasRotation, r, UpdateMode.Update); if (hasActivePaint) _ = measured.Add(visualSeparator); - - if (_stepCount++ > 10000) ThrowInfiniteSeparators(); } foreach (var separatorValueKey in separators.ToArray()) @@ -810,6 +805,10 @@ private IEnumerable EnumerateSeparators(double start, double end, double } var relativeEnd = end - start; + if (relativeEnd / step > 10000) + { + ThrowInfiniteSeparators(); + } for (var i = 0d; i <= relativeEnd; i += step) yield return start + i; } @@ -891,8 +890,6 @@ public virtual LvcSize GetPossibleSize(Chart chart) var m = textGeometry.Measure(LabelsPaint); if (m.Width > w) w = m.Width; if (m.Height > h) h = m.Height; - - if (_stepCount++ > 10000) ThrowInfiniteSeparators(); } return new LvcSize(w, h); @@ -1046,8 +1043,6 @@ private LvcSize GetPossibleMaxLabelSize() maxLabelSize = new LvcSize( maxLabelSize.Width > m.Width ? maxLabelSize.Width : m.Width, maxLabelSize.Height > m.Height ? maxLabelSize.Height : m.Height); - - if (_stepCount++ > 10000) ThrowInfiniteSeparators(); } return maxLabelSize; @@ -1456,8 +1451,9 @@ private string TryGetLabelOrLogError(Func labeler, double value) private void ThrowInfiniteSeparators() { + var axisName = string.IsNullOrEmpty(Name) ? "" : $"named \"{Name}\" "; throw new Exception( - $"The {_orientation} axis has an excessive number of separators. " + + $"The {_orientation} axis {axisName}has an excessive number of separators. " + $"If you set the step manually, ensure the number of separators is less than 10,000. " + $"This could also be caused because you are zooming too deep, " + $"try to set a limit to the current chart zoom using the Axis.{nameof(MinZoomDelta)} property. " +