Browse Source

Added some explanatory comments.

Steven Kirk 3 years ago
parent
commit
8d3af8a9b4
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/Avalonia.Controls/Viewbox.cs

+ 5 - 0
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;
         }
 
+        /// <summary>
+        /// A simple container control which hosts its child as a visual but not logical child.
+        /// </summary>
         private class ViewboxContainer : Control
         {
             private IControl? _child;