浏览代码

Fix horizontal StackLayout.

Steven Kirk 6 年之前
父节点
当前提交
ac660567f7
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/Avalonia.Layout/StackLayout.cs

+ 3 - 1
src/Avalonia.Layout/StackLayout.cs

@@ -293,9 +293,11 @@ namespace Avalonia.Layout
         {
             if (e.Property == OrientationProperty)
             {
+                var orientation = (Orientation)e.NewValue;
+
                 //Note: For StackLayout Vertical Orientation means we have a Vertical ScrollOrientation.
                 //Horizontal Orientation means we have a Horizontal ScrollOrientation.
-                _orientation.ScrollOrientation = (ScrollOrientation)e.NewValue;
+                _orientation.ScrollOrientation = orientation == Orientation.Horizontal ? ScrollOrientation.Horizontal : ScrollOrientation.Vertical;
             }
 
             InvalidateLayout();