public static void Configure(this UIView view, FigmaElipse elipse)
        {
            Configure(view, (FigmaVectorEntity)elipse);

            var circleLayer = new CAShapeLayer();
            var bezierPath  = UIBezierPath.FromOval(new CoreGraphics.CGRect(0, 0, elipse.absoluteBoundingBox.width, elipse.absoluteBoundingBox.height));

            //circleLayer.Path = bezierPath.ToGCPath();

            view.Layer.AddSublayer(circleLayer);

            var fills = elipse.fills.OfType <FigmaPaint>().FirstOrDefault();

            if (fills != null)
            {
                circleLayer.FillColor = fills.color.ToUIColor().CGColor;
            }

            var strokes = elipse.strokes.FirstOrDefault();

            if (strokes != null)
            {
                if (strokes.color != null)
                {
                    circleLayer.BorderColor = strokes.color.ToUIColor().CGColor;
                }
            }
        }
Esempio n. 2
0
        public static void Configure(this TransparentControl view, FigmaElipse elipse)
        {
            Configure(view, (FigmaVectorEntity)elipse);

            //var circleLayer = new CAShapeLayer();
            //var bezierPath = NSBezierPath.FromOvalInRect(new CGRect(0, 0, elipse.absoluteBoundingBox.width, elipse.absoluteBoundingBox.height));
            //circleLayer.Path = bezierPath.ToGCPath();

            //view.Layer.AddSublayer(circleLayer);

            //var fills = elipse.fills.OfType<FigmaPaint>().FirstOrDefault();
            //if (fills != null)
            //{
            //    circleLayer.FillColor = fills.color.ToNSColor().CGColor;
            //}

            //var strokes = elipse.strokes.FirstOrDefault();
            //if (strokes != null)
            //{
            //    if (strokes.color != null)
            //    {
            //        circleLayer.BorderColor = strokes.color.ToNSColor().CGColor;
            //    }
            //}
        }
Esempio n. 3
0
        public static void Configure(this FrameworkElement view, FigmaElipse child)
        {
            Configure(view, (FigmaVectorEntity)child);

            if (view is Panel canvas)
            {
                canvas.Children.Add(new Ellipse
                {
                    Width  = canvas.Width,
                    Height = canvas.Height,
                    Fill   = canvas.Background
                });

                canvas.Background = Brushes.Transparent;
            }
        }
Esempio n. 4
0
        public static void Configure(this NSView view, FigmaElipse elipse)
        {
            Configure(view, (FigmaNode)elipse);

            //var circleLayer = new CAShapeLayer();
            //var bezierPath = NSBezierPath.FromOvalInRect(new CGRect(0, 0, elipse.absoluteBoundingBox.Width, elipse.absoluteBoundingBox.Height));
            //circleLayer.Path = bezierPath.ToCGPath();

            //view.Layer.AddSublayer(circleLayer);

            //var fills = elipse.fills.OfType<FigmaPaint>().FirstOrDefault();
            //if (fills != null && fills.color != null)
            //{
            //    circleLayer.FillColor = fills.color.MixOpacity(fills.opacity).ToNSColor().CGColor;
            //} else
            //{
            //    circleLayer.FillColor = NSColor.Clear.CGColor;
            //}

            //var strokes = elipse.strokes.FirstOrDefault();
            //if (strokes != null)
            //{
            //    if (strokes.color != null)
            //    {
            //        circleLayer.StrokeColor = strokes.color.MixOpacity(strokes.opacity).ToNSColor().CGColor;
            //    }
            //}

            //if (elipse.strokeDashes != null)
            //{
            //    var number = new NSNumber[elipse.strokeDashes.Length];
            //    for (int i = 0; i < elipse.strokeDashes.Length; i++)
            //    {
            //        number[i] = elipse.strokeDashes[i];
            //    }
            //    circleLayer.LineDashPattern = number;
            //}

            //circleLayer.BackgroundColor = NSColor.Clear.CGColor;
            //circleLayer.LineWidth = elipse.strokeWeight;

            view.AlphaValue = elipse.opacity;
        }
 public static void Configure(this Xamarin.Forms.View view, FigmaElipse elipse)
 {
     Configure(view, (FigmaVectorEntity)elipse);
 }
Esempio n. 6
0
 public static void Configure(this Widget view, FigmaElipse elipse)
 {
     Configure(view, (FigmaVectorEntity)elipse);
     //TODO: NOT IMPLEMENTED
 }
Esempio n. 7
0
 public static void Configure(this UserControl view, FigmaElipse elipse)
 {
     Configure(view, (FigmaVectorEntity)elipse);
 }