Esempio n. 1
0
        public void Fill(object backend)
        {
            ContextInfo ctx = (ContextInfo)backend;

            if (ctx.Pattern is Gradient)
            {
                GradientInfo gr = (GradientInfo)WidgetRegistry.GetBackend(ctx.Pattern);
                NSGradient   g  = new NSGradient(gr.Colors.ToArray(), gr.Stops.ToArray());
                g.DrawInBezierPath(ctx.Path, 0f);
            }
            else
            {
                ctx.Path.Fill();
            }
            ctx.Pattern = null;
            ctx.Path.Dispose();
            ctx.Path = new NSBezierPath();
        }
Esempio n. 2
0
        public void Fill(object backend)
        {
            var ctx = GetContext(backend);

            if (ctx.Pattern is GradientInfo)
            {
                GradientInfo gr = (GradientInfo)ctx.Pattern;
                NSGradient   g  = new NSGradient(gr.Colors.ToArray(), gr.Stops.ToArray());
                g.DrawInBezierPath(ctx.Path, 0f);
            }
            else if (ctx.Pattern is NSColor)
            {
                NSColor col = (NSColor)ctx.Pattern;
                col.Set();
                col.SetFill();
            }
            else
            {
                ctx.Path.Fill();
            }
            ctx.Pattern = null;
            ctx.Path.Dispose();
            ctx.Path = new NSBezierPath();
        }