From 8d3af8a9b45f67b01aea4b6e60183c883e6b6d63 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Tue, 17 May 2022 10:01:55 +0200 Subject: [PATCH] Added some explanatory comments. --- src/Avalonia.Controls/Viewbox.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Avalonia.Controls/Viewbox.cs b/src/Avalonia.Controls/Viewbox.cs index 55c52d8ed9..0dea6359ba 100644 --- a/src/Avalonia.Controls/Viewbox.cs +++ b/src/Avalonia.Controls/Viewbox.cs @@ -37,6 +37,8 @@ namespace Avalonia.Controls public Viewbox() { + // The Child control is hosted inside a ViewboxContainer control so that the transform + // can be applied independently of the Viewbox and Child transforms. _containerVisual = new ViewboxContainer(); _containerVisual.RenderTransformOrigin = RelativePoint.TopLeft; VisualChildren.Add(_containerVisual); @@ -144,6 +146,9 @@ namespace Avalonia.Controls return finalSize; } + /// + /// A simple container control which hosts its child as a visual but not logical child. + /// private class ViewboxContainer : Control { private IControl? _child;