public static void CurvedRectangle(Cairo.Context c, RectangleD rect, double radius) { if (rect.Width < (radius * 2.0)) { radius = rect.Width / 2.0; } if (rect.Height < (radius * 2.0)) { radius = rect.Height / 2.0; } c.MoveTo(rect.X, rect.Y + radius); c.LineTo(rect.X, rect.Y2 - radius); c.CurveTo(rect.X, rect.Y2 - radius, rect.X, rect.Y2, rect.X + radius, rect.Y2); c.LineTo(rect.X2 - radius, rect.Y2); c.CurveTo(rect.X2 - radius, rect.Y2, rect.X2, rect.Y2, rect.X2, rect.Y2 - radius); c.LineTo(rect.X2, rect.Y + radius); c.CurveTo(rect.X2, rect.Y + radius, rect.X2, rect.Y, rect.X2 - radius, rect.Y); c.LineTo(rect.X + radius, rect.Y); c.CurveTo(rect.X + radius, rect.Y, rect.X, rect.Y, rect.X, rect.Y + radius); c.ClosePath(); }
public static Gdk.Rectangle GdkRectangle(RectangleD r) { return(new Gdk.Rectangle((int)r.X, (int)r.Y, (int)r.Width, (int)r.Height)); }
public static Cairo.Rectangle CairoRectangle(RectangleD r) { return(new Cairo.Rectangle(r.X, r.Y, r.Width, r.Height)); }
public static void AngleFrame(Cairo.Context c, Gdk.Rectangle gdkRect, double angleLeft, double angleTop, double angleRight, double angleBottom) { RectangleD rect = new RectangleD(gdkRect.X, gdkRect.Y, gdkRect.Width, gdkRect.Height); AngleFrame(c, rect, angleLeft, angleTop, angleRight, angleBottom); }