|
4 | 4 |
|
5 | 5 | using System; |
6 | 6 | using System.Collections.Generic; |
7 | | -using System.Runtime.InteropServices.WindowsRuntime; |
8 | 7 | using Windows.Foundation; |
9 | | -using Windows.UI.Xaml; |
10 | 8 | using Windows.UI.Xaml.Controls; |
11 | 9 |
|
12 | 10 | namespace Microsoft.Toolkit.Uwp.UI.Controls |
@@ -54,64 +52,6 @@ private struct UvRect |
54 | 52 |
|
55 | 53 | public UvMeasure Size { get; set; } |
56 | 54 |
|
57 | | - public UvRect WithVerticalAlignment(VerticalAlignment alignment, double maxHeight) |
58 | | - { |
59 | | - switch (alignment) |
60 | | - { |
61 | | - case VerticalAlignment.Center: |
62 | | - return new UvRect |
63 | | - { |
64 | | - Position = Position.Add( |
65 | | - u: 0, |
66 | | - v: Math.Max((maxHeight - Size.V) / 2.0, 0.0)), |
67 | | - Size = Size, |
68 | | - }; |
69 | | - case VerticalAlignment.Bottom: |
70 | | - return new UvRect |
71 | | - { |
72 | | - Position = Position.Add( |
73 | | - u: 0, |
74 | | - v: Math.Max(maxHeight - Size.V, 0.0)), |
75 | | - Size = Size, |
76 | | - }; |
77 | | - case VerticalAlignment.Stretch: |
78 | | - return new UvRect |
79 | | - { |
80 | | - Position = Position, |
81 | | - Size = new UvMeasure { U = Size.U, V = maxHeight }, |
82 | | - }; |
83 | | - case VerticalAlignment.Top: |
84 | | - default: |
85 | | - return this; |
86 | | - } |
87 | | - } |
88 | | - |
89 | | - public UvRect WithHorizontalAlignment(HorizontalAlignment alignment, double maxHeight) |
90 | | - { |
91 | | - // Since (U,V) coordinates are flipped, we can use the exact same logic as for the vertical alignment |
92 | | - // We just convert the HorizontalAlignment values to VerticalAlignment values (more or less a no-op |
93 | | - // since the integer values are the same). |
94 | | - VerticalAlignment verticalAlignment; |
95 | | - switch (alignment) |
96 | | - { |
97 | | - case HorizontalAlignment.Center: |
98 | | - verticalAlignment = VerticalAlignment.Center; |
99 | | - break; |
100 | | - case HorizontalAlignment.Right: |
101 | | - verticalAlignment = VerticalAlignment.Bottom; |
102 | | - break; |
103 | | - case HorizontalAlignment.Stretch: |
104 | | - verticalAlignment = VerticalAlignment.Stretch; |
105 | | - break; |
106 | | - case HorizontalAlignment.Left: |
107 | | - default: |
108 | | - verticalAlignment = VerticalAlignment.Top; |
109 | | - break; |
110 | | - } |
111 | | - |
112 | | - return WithVerticalAlignment(verticalAlignment, maxHeight); |
113 | | - } |
114 | | - |
115 | 55 | public Rect ToRect(Orientation orientation) |
116 | 56 | { |
117 | 57 | switch (orientation) |
|
0 commit comments