From a6c446d022dbe206acdb3cee3b12c5127587f364 Mon Sep 17 00:00:00 2001 From: BobLd <38405645+BobLd@users.noreply.github.com> Date: Sat, 3 Aug 2024 13:42:29 +0100 Subject: [PATCH] Increase LayoutTransformControl.DecimalsAfterRound from 4 to 8 (#16583) Co-authored-by: Julien Lebosquain --- src/Avalonia.Controls/LayoutTransformControl.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Avalonia.Controls/LayoutTransformControl.cs b/src/Avalonia.Controls/LayoutTransformControl.cs index efd2cc395c..6cd2ee14bb 100644 --- a/src/Avalonia.Controls/LayoutTransformControl.cs +++ b/src/Avalonia.Controls/LayoutTransformControl.cs @@ -192,6 +192,14 @@ namespace Avalonia.Controls ApplyLayoutTransform(); } + /* + * About AcceptableDelta and DecimalsAfterRound - Original comment from the Silverlight code explains: + * // Note: AcceptableDelta and DecimalsAfterRound work around double arithmetic rounding issues on Silverlight. + * + * The DecimalsAfterRound property here was increased from the original 4 to 8 because of issues when zooming in + * and out at the end of very large objects. + */ + /// /// Acceptable difference between two doubles. /// @@ -200,7 +208,7 @@ namespace Avalonia.Controls /// /// Number of decimals to round the Matrix to. /// - private const int DecimalsAfterRound = 4; + private const int DecimalsAfterRound = 8; /// /// Actual DesiredSize of Child element (the value it returned from its MeasureOverride method).