public XLine Deserialize(ISheet sheet, XBlock parent, ItemLine lineItem, double thickness) { var line = _blockFactory.CreateLine(thickness, lineItem.X1, lineItem.Y1, lineItem.X2, lineItem.Y2, lineItem.Stroke); line.Id = lineItem.Id; line.StartId = lineItem.StartId; line.EndId = lineItem.EndId; parent.Lines.Add(line); sheet.Add(line); return(line); }
public void CreateLine(ISheet sheet, IList <XLine> lines, double thickness, double x1, double y1, double x2, double y2, ArgbColor stroke) { var line = _blockFactory.CreateLine(thickness, x1, y1, x2, y2, stroke); if (lines != null) { lines.Add(line); } if (sheet != null) { sheet.Add(line); } }
public void Init(ImmutablePoint p, XPoint start) { double x = _itemController.Snap(p.X, _state.Options.SnapSize); double y = _itemController.Snap(p.Y, _state.Options.SnapSize); TempLine = _blockFactory.CreateLine(_state.Options.LineThickness / _state.ZoomController.Zoom, x, y, x, y, ArgbColors.Black); if (start != null) { TempLine.Start = start; } TempStartEllipse = _blockFactory.CreateEllipse(_state.Options.LineThickness / _state.ZoomController.Zoom, x - 4.0, y - 4.0, 8.0, 8.0, true, ArgbColors.Black, ArgbColors.Black); TempEndEllipse = _blockFactory.CreateEllipse(_state.Options.LineThickness / _state.ZoomController.Zoom, x - 4.0, y - 4.0, 8.0, 8.0, true, ArgbColors.Black, ArgbColors.Black); _state.OverlaySheet.Add(TempLine); _state.OverlaySheet.Add(TempStartEllipse); _state.OverlaySheet.Add(TempEndEllipse); _state.OverlaySheet.Capture(); }