public void AddLine(Segment2d segment, Style style) { Segment2dBox segbox = new Segment2dBox(segment); Objects.Add(segbox); Styles[segbox] = style; Bounds.Contain(segment.P0); Bounds.Contain(segment.P1); }
void write_line(Segment2dBox segbox, StreamWriter w) { Segment2d seg = (Segment2d)segbox; StringBuilder b = new StringBuilder(); b.Append("<line "); Vector2d p0 = MapPt(seg.P0), p1 = MapPt(seg.P1); append_property("x1", p0.x, b, true); append_property("y1", p0.y, b, true); append_property("x2", p1.x, b, true); append_property("y2", p1.y, b, true); append_style(b, segbox, ref DefaultLineStyle); b.Append(" />"); w.WriteLine(b); }