diff --git a/SS14.Launcher/Views/AngleBox.cs b/SS14.Launcher/Views/AngleBox.cs index 39af4442..0a6f199d 100644 --- a/SS14.Launcher/Views/AngleBox.cs +++ b/SS14.Launcher/Views/AngleBox.cs @@ -16,6 +16,7 @@ public static readonly StyledProperty SideStyleProperty static AngleBox() { + AffectsMeasure(CornerSizeProperty, SideStyleProperty); AffectsGeometry(BoundsProperty, CornerSizeProperty, SideStyleProperty); } @@ -31,6 +32,21 @@ public AngleBoxSideStyle SideStyle set => SetValue(SideStyleProperty, value); } + protected override Size MeasureOverride(Size availableSize) + { + var style = SideStyle; + var c = CornerSize; + + var size = new Size(); + if ((style & AngleBoxSideStyle.OpenRight) == 0) + size += new Size(c, c); + + if ((style & AngleBoxSideStyle.OpenLeft) == 0) + size += new Size(c, c); + + return size; + } + protected override Geometry CreateDefiningGeometry() { var style = SideStyle;