예제 #1
0
        public static void UpdateStrokeLineCap(this AView platformView, IBorderStroke border)
        {
            MauiDrawable?mauiDrawable = platformView.Background as MauiDrawable;
            bool         hasBorder    = border.Shape != null && border.Stroke != null;

            if (mauiDrawable == null && !hasBorder)
            {
                return;
            }

            mauiDrawable?.SetBorderLineCap(border.StrokeLineCap);
        }
예제 #2
0
        public static void UpdateBorderStroke(this AView platformView, IBorderStroke border)
        {
            // Always set the drawable first
            platformView.UpdateMauiDrawable(border);

            var          borderShape  = border.Shape;
            MauiDrawable?mauiDrawable = platformView.Background as MauiDrawable;

            if (mauiDrawable == null && borderShape == null)
            {
                return;
            }

            mauiDrawable?.SetBorderBrush(border.Stroke);
            mauiDrawable?.SetBorderWidth(border.StrokeThickness);
            platformView.UpdateStrokeDashPattern(border);
            platformView.UpdateStrokeDashOffset(border);
            mauiDrawable?.SetBorderMiterLimit(border.StrokeMiterLimit);
            mauiDrawable?.SetBorderLineCap(border.StrokeLineCap);
            mauiDrawable?.SetBorderLineJoin(border.StrokeLineJoin);
        }