From ad4b8635445b3d3e8d5a7cb5e2be0292ba5f6cdc Mon Sep 17 00:00:00 2001 From: JC-Chung <52159296+JC-Chung@users.noreply.github.com> Date: Fri, 2 Oct 2026 17:05:30 +0800 Subject: [PATCH 1/2] =?UTF-8?q?typo:=20`=5FlastHoverred`=20=E2=86=92=20`?= =?UTF-8?q?=5FlastHovered`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Views/PieChart.cs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Views/PieChart.cs b/src/Views/PieChart.cs index b143bcbc7..1b83986d1 100644 --- a/src/Views/PieChart.cs +++ b/src/Views/PieChart.cs @@ -78,7 +78,7 @@ public override void Render(DrawingContext context) base.Render(context); _arcs.Clear(); - _lastHoverred = null; + _lastHovered = null; var w = Bounds.Width; var h = Bounds.Height; @@ -248,7 +248,7 @@ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs chang if (change.Property == ReportProperty) { - _lastHoverred = null; + _lastHovered = null; HoveringTip = null; } @@ -265,7 +265,7 @@ protected override void OnPointerMoved(PointerEventArgs e) if (_report == null || _report.Authors.Count == 0) { - _lastHoverred = null; + _lastHovered = null; HoveringTip = null; return; } @@ -274,7 +274,7 @@ protected override void OnPointerMoved(PointerEventArgs e) var distance = Math.Sqrt(Math.Pow(pos.X - _center.X, 2) + Math.Pow(pos.Y - _center.Y, 2)); if (distance > _radius) { - _lastHoverred = null; + _lastHovered = null; HoveringTip = null; return; } @@ -287,16 +287,16 @@ protected override void OnPointerMoved(PointerEventArgs e) { if (angle >= arc.StartAngle && angle < arc.EndAngle) { - if (_lastHoverred == arc) + if (_lastHovered == arc) return; - _lastHoverred = arc; + _lastHovered = arc; HoveringTip = arc.Tip; return; } } - _lastHoverred = null; + _lastHovered = null; HoveringTip = null; } @@ -304,15 +304,15 @@ protected override void OnPointerPressed(PointerPressedEventArgs e) { base.OnPointerPressed(e); - if (_lastHoverred != null) + if (_lastHovered != null) { var statisticsView = this.FindAncestorOfType(); if (statisticsView is { DataContext: ViewModels.Statistics vm }) { - if (_lastHoverred.Author == null || _lastHoverred.Author == vm.SelectedAuthor) + if (_lastHovered.Author == null || _lastHovered.Author == vm.SelectedAuthor) vm.ChangeAuthor(null); else - vm.ChangeAuthor(_lastHoverred.Author); + vm.ChangeAuthor(_lastHovered.Author); } } } @@ -370,7 +370,7 @@ public Arc(double startAngle, double sweepAngle, string title, int count, double private Point _center = new Point(0, 0); private double _radius = 0; private List _arcs = new List(); - private Arc _lastHoverred = null; + private Arc _lastHovered = null; private PieChartToolTip _hoveringTip = null; } } From 4d049fb0c2393d62e7f757556a998d5061bdb4aa Mon Sep 17 00:00:00 2001 From: JC-Chung <52159296+JC-Chung@users.noreply.github.com> Date: Fri, 2 Oct 2026 17:06:45 +0800 Subject: [PATCH 2/2] enhance: render Others slice with secondary foreground color --- src/Views/PieChart.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Views/PieChart.cs b/src/Views/PieChart.cs index 1b83986d1..1571227b0 100644 --- a/src/Views/PieChart.cs +++ b/src/Views/PieChart.cs @@ -125,10 +125,10 @@ public override void Render(DrawingContext context) foreach (var author in _report.Authors) { var percent = (double)author.Count / total; - var brush = s_brushes[brushIndex]; if (percent > 0.01) { var sweepAngle = percent * 2 * Math.PI; + var brush = s_brushes[brushIndex]; DrawArc(context, startAngle, sweepAngle, brush); var arc = new Arc(startAngle, sweepAngle, author.User.Name, author.Count, percent, brush, author); @@ -146,10 +146,11 @@ public override void Render(DrawingContext context) else { var sweepAngle = remaining; + var othersBrush = secondaryForeground; var count = total - renderedCount; - DrawArc(context, startAngle, sweepAngle, brush); + DrawArc(context, startAngle, sweepAngle, othersBrush); - var arc = new Arc(startAngle, sweepAngle, "Others", count, (double)count / total, brush, null); + var arc = new Arc(startAngle, sweepAngle, "Others", count, (double)count / total, othersBrush, null); _arcs.Add(arc); if (arc.IsLeftSide) leftArcs.Add(arc);