internal void ConstructVisualElements(ITextRunConstructionContext context, VisualLineElementGenerator[] generators) { //TODO: VisualLine.ConstructVisualElements() throw new NotImplementedException(); }
VisualLine BuildVisualLine(DocumentLine documentLine, TextRunProperties textRunProperties, TextParagraphProperties paragraphProperties, VisualLineElementGenerator[] generators, IVisualLineTransformer[] transformers, Size availableSize) { if (heightTree.GetIsCollapsed(documentLine)) { throw new InvalidOperationException(); } var visualLine = new VisualLine(documentLine); var textSource = new VisualLineTextSource(visualLine) { Document = this.Document, GlobalTextRunProperties = textRunProperties, TextView = this }; visualLine.ConstructVisualElements(textSource, generators); visualLine.RunTransformers(textSource, transformers); int offset = 0; TextLineBreak lineBreak = null; var textLines = new List<TextLine>(); while (offset <= visualLine.VisualLength) { TextLine tl = textFormatter.FormatLine(textSource, offset, availableSize.Width, paragraphProperties, lineBreak); textLines.Add(tl); offset += tl.Length; lineBreak = tl.GetTextLineBreak(); } visualLine.SetTextLines(textLines); heightTree.SetHeight(visualLine.FirstDocumentLine, visualLine.Height); return visualLine; }