// scene public static XElement Document(Orthotope2Double viewBox, IEnumerable <XElement> items) { return(new XElement ( Namespace + "svg", new XAttribute("viewBox", Rectangle(viewBox)), new XAttribute("version", "1.1"), items )); }
public static void DrawRectangle(Context context, Orthotope2Double bounds, Krach.Graphics.Color color, bool fill) { context.Rectangle(bounds.Start.X + 0.5, bounds.Start.Y + 0.5, bounds.Size.X - 1, bounds.Size.Y - 1); context.LineWidth = 1; context.LineCap = LineCap.Butt; context.Color = Drawing.ToCairoColor(color); if (fill) { context.Fill(); } else { context.Stroke(); } }
public static Orthotope2Double Map(this IMap <Vector2Double, Vector2Double> map, Orthotope2Double orthotope) { return(new Orthotope2Double(map.Map(orthotope.Start), map.Map(orthotope.End))); }
public static string Rectangle(Orthotope2Double rectangle) { return(string.Format("{0} {1} {2} {3}", rectangle.Start.X, rectangle.Start.Y, rectangle.Size.X, rectangle.Size.Y)); }