diff options
Diffstat (limited to 'Xamarin.PropertyEditing.Mac')
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushLayer.cs | 5 | ||||
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushView.cs | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushLayer.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushLayer.cs index 543538f..80f992b 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushLayer.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushLayer.cs @@ -9,6 +9,8 @@ namespace Xamarin.PropertyEditing.Mac internal class CommonBrushLayer : CALayer { + private const double VerticalMarginOffset = 0.5; + public CommonBrushLayer (IHostResourceProvider hostResources) { if (hostResources == null) @@ -22,6 +24,8 @@ namespace Xamarin.PropertyEditing.Mac MasksToBounds = true; } + internal uint VerticalMargin { get; set; } + private CALayer brushLayer; private CALayer BrushLayer { get => brushLayer; @@ -68,6 +72,7 @@ namespace Xamarin.PropertyEditing.Mac public override void LayoutSublayers () { base.LayoutSublayers (); + Frame = new CGRect (Frame.X, Bounds.Y + VerticalMargin + VerticalMarginOffset, Bounds.Width, Bounds.Height - (VerticalMargin * 2)); BrushLayer.Frame = Bounds; Contents = DrawingExtensions.GenerateCheckerboard (Bounds, this.hostResources.GetNamedColor (NamedResources.Checkerboard0Color), this.hostResources.GetNamedColor (NamedResources.Checkerboard1Color)); } diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushView.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushView.cs index 9f4531f..6fd6ac2 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushView.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/CommonBrushView.cs @@ -39,7 +39,8 @@ namespace Xamarin.PropertyEditing.Mac { WantsLayer = true; Layer = new CommonBrushLayer (hostResources) { - Brush = Brush + Brush = Brush, + VerticalMargin = 1 }; } } |