From 5fb0208c32f20b549f54c109bb055ccc1ae67ca9 Mon Sep 17 00:00:00 2001 From: izakusilov Date: Sat, 24 Oct 2026 13:47:52 +0000 Subject: [PATCH 1/4] Fix TrackerControl corner radius and border updates --- Source/OxyPlot.Avalonia/Tracker/TrackerControl.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Source/OxyPlot.Avalonia/Tracker/TrackerControl.cs b/Source/OxyPlot.Avalonia/Tracker/TrackerControl.cs index 35875a5..8d1b74f 100644 --- a/Source/OxyPlot.Avalonia/Tracker/TrackerControl.cs +++ b/Source/OxyPlot.Avalonia/Tracker/TrackerControl.cs @@ -19,6 +19,7 @@ namespace OxyPlot.Avalonia using global::Avalonia.Layout; using global::Avalonia.Media; using global::Avalonia.VisualTree; + using System; using System.Collections.Generic; using System.Linq; @@ -60,7 +61,7 @@ public class TrackerControl : ContentControl /// /// Identifies the dependency property. /// - public static readonly StyledProperty CornerRadiusProperty = AvaloniaProperty.Register(nameof(CornerRadius), 0.0); + public static new readonly StyledProperty CornerRadiusProperty = AvaloniaProperty.Register(nameof(CornerRadius), 0.0); /// /// Identifies the dependency property. @@ -139,6 +140,11 @@ static TrackerControl() { ClipToBoundsProperty.OverrideDefaultValue(false); PositionProperty.Changed.AddClassHandler(PositionChanged); + + // The border is built by UpdatePositionAndBorder, so it must be rebuilt when the shape changes too + CornerRadiusProperty.Changed.AddClassHandler(PositionChanged); + ShowPointerProperty.Changed.AddClassHandler(PositionChanged); + DistanceProperty.Changed.AddClassHandler(PositionChanged); } /// @@ -240,7 +246,7 @@ public bool ShowPointer /// /// Gets or sets the corner radius (only used when ShowPoint=false). /// - public double CornerRadius + public new double CornerRadius { get { @@ -488,7 +494,9 @@ private Geometry CreateBorderGeometry( va == VerticalAlignment.Top ? m : 0, ha == HorizontalAlignment.Right ? m : 0, va == VerticalAlignment.Bottom ? m : 0); - return new RectangleGeometry(rect)/* { RadiusX = this.CornerRadius, RadiusY = this.CornerRadius }*/; + // The radius is at most half of the smaller side, otherwise the rounded corners overlap + var radius = Math.Max(0, Math.Min(CornerRadius, Math.Min(width, height) / 2)); + return new RectangleGeometry(rect, radius, radius); } /// From 0229d9e2d1f63a3f5e95dfeb562df229dd70884e Mon Sep 17 00:00:00 2001 From: izakusilov Date: Sat, 24 Oct 2026 13:47:52 +0000 Subject: [PATCH 2/4] Apply default styles to derived plot controls --- Source/OxyPlot.Avalonia/Themes/Default.axaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/OxyPlot.Avalonia/Themes/Default.axaml b/Source/OxyPlot.Avalonia/Themes/Default.axaml index 6b5dcf4..43f776c 100644 --- a/Source/OxyPlot.Avalonia/Themes/Default.axaml +++ b/Source/OxyPlot.Avalonia/Themes/Default.axaml @@ -5,7 +5,9 @@ xmlns:local="http://oxyplot.org/avalonia" xmlns:oxy="clr-namespace:OxyPlot;assembly=OxyPlot"> - - -