public void DrawRoundRect(float x, float y, float w, float h, float rx, float ry)
        {
            roundRect.SetRect(x, y, x + w, y + h);
            roundRect.SetRadius(rx, ry);
            var vxs = this.aggStroke.MakeVxs(roundRect.MakeVxs());

            switch (this.SmoothMode)
            {
            case CanvasSmoothMode.AggSmooth:
            {
                sclineRas.Reset();
                sclineRas.AddPath(vxs);
                sclineRasToGL.DrawWithColor(sclineRas, sclinePack8, this.strokeColor);
            }
            break;

            default:
            {
                sclineRas.Reset();
                sclineRas.AddPath(vxs);
                sclineRasToGL.DrawWithColor(sclineRas, sclinePack8, this.strokeColor);
            }
            break;
            }
        }
Exemple #2
0
 public void FillRoundRectangle(double left, double bottom, double right, double top, double radius)
 {
     if (roundRect == null)
     {
         roundRect = new RoundedRect(left, bottom, right, top, radius);
         roundRect.NormalizeRadius();
     }
     else
     {
         roundRect.SetRect(left, bottom, right, top);
         roundRect.SetRadius(radius);
         roundRect.NormalizeRadius();
     }
     this.Fill(roundRect.MakeVxs());
 }
        public override void DrawRoundRect(double left, double bottom, double right, double top, double radius)
        {
            if (roundRect == null)
            {
                roundRect = new RoundedRect(left, bottom, right, top, radius);
                roundRect.NormalizeRadius();
            }
            else
            {
                roundRect.SetRect(left, bottom, right, top);
                roundRect.SetRadius(radius);
                roundRect.NormalizeRadius();
            }
            var v1 = GetFreeVxs();

            this.Draw(roundRect.MakeVxs(v1));
            ReleaseVxs(ref v1);
        }
        public static void Rectangle(this Graphics2D gx, double left, double bottom, double right, double top, ColorRGBA color, double strokeWidth = 1)
        {
            RoundedRect rect = new RoundedRect(left + .5, bottom + .5, right - .5, top - .5, 0);

            gx.Render(new Stroke(strokeWidth).MakeVxs(rect.MakeVxs()), color);
        }