From eba166cdcbe8d468396682bb52d432778ea00e6a Mon Sep 17 00:00:00 2001 From: chinboy Date: Tue, 5 May 2026 12:22:58 +0800 Subject: [PATCH] =?UTF-8?q?docs(skill):=20add=20MathUtilities=20=E2=86=92?= =?UTF-8?q?=20MathUtils=20migration=20guide=20to=20Avalonia=2012=20skill?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Document that Avalonia.Utilities.MathUtilities is now internal in Avalonia 12 - Add detection pattern for MathUtilities usage - Document fix: use AtomUI.Utils.MathUtils as public wrapper - Explain that MathUtils provides identical epsilon-based floating-point comparison methods --- .agents/skills/migrate-to-avalonia12/SKILL.md | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.agents/skills/migrate-to-avalonia12/SKILL.md b/.agents/skills/migrate-to-avalonia12/SKILL.md index 6c07cb8f4..03a7bdedb 100644 --- a/.agents/skills/migrate-to-avalonia12/SKILL.md +++ b/.agents/skills/migrate-to-avalonia12/SKILL.md @@ -1139,6 +1139,7 @@ var args = ResourcesChangedEventArgs.Create(); ```csharp Gestures.TappedEvent Gestures.DoubleTappedEvent +Gestures.ScrollGestureEndedEvent ``` **Fix:** @@ -1148,8 +1149,33 @@ Gestures.DoubleTappedEvent ```csharp InputElement.TappedEvent InputElement.DoubleTappedEvent +InputElement.ScrollGestureEndedEvent ``` +#### 28.1. MathUtilities Class Now Internal (MEDIUM) + +**What changed:** `Avalonia.Utilities.MathUtilities` class is now `internal`. All floating-point comparison methods (`AreClose`, `LessThan`, `GreaterThan`, `IsZero`, `IsOne`, etc.) are no longer accessible from external assemblies. + +**Detection:** +```csharp +using Avalonia.Utilities; + +if (MathUtilities.AreClose(value1, value2)) +if (MathUtilities.LessThan(a, b)) +if (MathUtilities.IsZero(value)) +``` + +**Fix:** +```csharp +using AtomUI.Utils; + +if (MathUtils.AreClose(value1, value2)) +if (MathUtils.LessThan(a, b)) +if (MathUtils.IsZero(value)) +``` + +**Why:** AtomUI provides `AtomUI.Utils.MathUtils` as a public wrapper around the internal `MathUtilities` class. This class contains the same floating-point comparison methods with identical epsilon-based logic. Use `MathUtils` instead of attempting to access the internal `MathUtilities` via reflection. + #### 29. Window.WindowState (MEDIUM) **What changed:** Now a direct property, not styled property. Can't set from style.