public override RectangleF bounds(Transform t) { PointF zero = t.transform(new PointF((float)x, (float)y)); RectangleF r = RendererUtilities.MakeRectangleF(zero.X, zero.Y, zero.X, zero.Y); r.Inflate(size / 2.0f + Stroke.Width / 2.0f, size / 2.0f + Stroke.Width / 2.0f); return(r); //return Children.OrderBy(m => m.Order).Aggregate(RectangleF.Empty, (t, m) => t.Union(m.bounds(transform.Concat(Transform)))); }
public override void render(Graphics g, Transform t) { PointF zero = t.transform(new PointF((float)x0(), (float)y0())); PointF one = t.transform(new PointF((float)x1(), (float)y1())); RectangleF rect = RendererUtilities.MakeRectangleF(zero.X, zero.Y, one.X, one.Y); System.Drawing.Drawing2D.SmoothingMode oldMode = g.SmoothingMode; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default; g.FillRectangle(Fill, rect); g.DrawRectangle(Stroke, rect.X, rect.Y, rect.Width, rect.Height); g.SmoothingMode = oldMode; }