Fix CodeFactor issues in RingChartControl.cs
MODIFY
WalletWasabi.Fluent/Controls/RingChartControl.cs
WalletWasabi.Fluent/Controls/RingChartControl.cs
@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Linq;
using Avalonia;
using Avalonia.Controls;
-using Avalonia.Controls.Primitives;
using Avalonia.Media;
using Avalonia.Media.Immutable;
@@ -13,10 +12,8 @@ namespace WalletWasabi.Fluent.Controls
{
static RingChartControl()
{
- AffectsRender<RingChartControl>(DataPointsProperty, ThicknessProperty, StartAngleProperty,
- EndAngleProperty);
- AffectsMeasure<RingChartControl>(DataPointsProperty, ThicknessProperty, StartAngleProperty,
- EndAngleProperty);
+ AffectsRender<RingChartControl>(DataPointsProperty, ThicknessProperty, StartAngleProperty, EndAngleProperty);
+ AffectsMeasure<RingChartControl>(DataPointsProperty, ThicknessProperty, StartAngleProperty, EndAngleProperty);
}
public static readonly StyledProperty<IList<(string ColorHex, double PercentShare)>> DataPointsProperty =
@@ -37,6 +34,26 @@ namespace WalletWasabi.Fluent.Controls
set => SetValue(DataPointsProperty, value);
}
+ private double Radius { get; set; }
+
+ public double StartAngle
+ {
+ get => GetValue(StartAngleProperty);
+ set => SetValue(StartAngleProperty, value);
+ }
+
+ public double EndAngle
+ {
+ get => GetValue(EndAngleProperty);
+ set => SetValue(EndAngleProperty, value);
+ }
+
+ public double Thickness
+ {
+ get => GetValue(ThicknessProperty);
+ set => SetValue(ThicknessProperty, value);
+ }
+
public double Map(double value, double from1, double to1, double from2, double to2)
{
return (value - from1) / (to1 - from1) * (to2 - from2) + from2;
@@ -100,26 +117,6 @@ namespace WalletWasabi.Fluent.Controls
return (Math.PI / 180d) * angle;
}
- private double Radius { get; set; }
-
- public double StartAngle
- {
- get => GetValue(StartAngleProperty);
- set => SetValue(StartAngleProperty, value);
- }
-
- public double EndAngle
- {
- get => GetValue(EndAngleProperty);
- set => SetValue(EndAngleProperty, value);
- }
-
- public double Thickness
- {
- get => GetValue(ThicknessProperty);
- set => SetValue(ThicknessProperty, value);
- }
-
public override void Render(DrawingContext context)
{
if (DataPoints is null)
@@ -141,8 +138,10 @@ namespace WalletWasabi.Fluent.Controls
lastData += dataPoint.PercentShare;
var curValue = Map((dataPoint.PercentShare == 1.0 ? 0.99 : lastData), 0, 1, StartAngle, EndAngle);
- context.DrawGeometry(null, new ImmutablePen(brush, Thickness),
- GetArcGeometry(lastAngle, curValue, (dataPoint.PercentShare == 1.0d)));
+ context.DrawGeometry(
+ null,
+ new ImmutablePen(brush, Thickness),
+ GetArcGeometry(lastAngle, curValue, dataPoint.PercentShare == 1.0d));
lastAngle = curValue;
}

Fix CodeFactor issues in RingChartControl.cs