Ejemplo n.º 1
0
        private static XElement ToXElement(ProjectedLine line)
        {
            var scale = (line.P2 - line.P1).Length / (line.OriginalLine.P2 - line.OriginalLine.P1).Length;
            var xml   = new XElement(SvgPlotter.Xmlns + "line",
                                     new XAttribute("x1", line.P1.X),
                                     new XAttribute("y1", line.P1.Y),
                                     new XAttribute("x2", line.P2.X),
                                     new XAttribute("y2", line.P2.Y));

            AddStrokeIfNotDefault(xml, line.OriginalLine.Color);
            AddStrokeWidth(xml, scale * line.OriginalLine.Thickness);
            return(xml);
        }
Ejemplo n.º 2
0
 private void DrawEntity(Graphics graphics, ProjectedLine line, CadColor?layerColor, Vector offset)
 {
     graphics.DrawLine(ColorToPen(layerColor ?? line.OriginalLine.Color ?? autoColor), (line.P1 + offset).ToPointF(), (line.P2 + offset).ToPointF());
 }