public WordGlyph(Word word) { Word = word; var path = new GraphicsPath(); Figure = new SolidFigure(path); if (Word.Polygons != null && Word.Polygons.Count > 0) { foreach (Polygon polygon in Word.Polygons) { path.AddPath(Functions.GeneratePathFromPoints(polygon.ConvertToDrawingPoints()), false); } } Figures = new List <Figure>(); if (Word.Polygons != null && Word.Polygons.Count > 0) { foreach (Polygon polygon in Word.Polygons) { Figures.Add(new SolidFigure(Functions.GeneratePathFromPoints(polygon.ConvertToDrawingPoints()))); } } Figure.Path.CloseAllFigures();; Childs = new List <Glyph>(); }
public LineGlyph(Line line) { Line = line; var path = new GraphicsPath(); if (line.Polygon != null && (line.Polygon.Points != null && line.Polygon.Points.Count > 0)) { path = Functions.GeneratePathFromPoints(Line.Polygon.ConvertToDrawingPoints()); } Figure = new SolidFigure(path); Childs = new List <Glyph>(); }
public override void UpdateLocation() { var line = (TargetFigure as LineFigure); if (line != null && (line.From == null || line.To == null)) { return; //не обновляем маркеры оторванных концов } //фигура, с которой связана линия if (line != null) { SolidFigure figure = _pointIndex == 0 ? line.From : line.To; Location = figure.Location; } }
public WordGlyph(Word word) { Word = word; var path = new GraphicsPath(); Figure = new SolidFigure(path); if (Word.Polygons != null && Word.Polygons.Count > 0) foreach (Polygon polygon in Word.Polygons) path.AddPath(Functions.GeneratePathFromPoints(polygon.ConvertToDrawingPoints()), false); Figures = new List<Figure>(); if (Word.Polygons != null && Word.Polygons.Count > 0) { foreach (Polygon polygon in Word.Polygons) Figures.Add(new SolidFigure(Functions.GeneratePathFromPoints(polygon.ConvertToDrawingPoints()))); } Figure.Path.CloseAllFigures(); ; Childs = new List<Glyph>(); }
public LineGlyph(Line line) { Line = line; var path = new GraphicsPath(); if (line.Polygon != null && (line.Polygon.Points != null && line.Polygon.Points.Count > 0)) path = Functions.GeneratePathFromPoints(Line.Polygon.ConvertToDrawingPoints()); Figure = new SolidFigure(path); Childs = new List<Glyph>(); }