Пример #1
0
 protected override void OnRender(DrawingContext drawingContext)
 {
     foreach (var renderTarget in _renderTargets)
     {
         _textLine.Draw(drawingContext, renderTarget, InvertAxes.None);
     }
 }
Пример #2
0
        // ------------------------------------------------------------------
        // Render formatted line.
        //
        //      ctx - Drawing context to be used for rendering.
        //      lineOffset - Offset of the line.
        //      wrappingWidth - Wrapping width for the line.
        // ------------------------------------------------------------------
        internal void Render(DrawingContext ctx, Point lineOffset)
        {
            Debug.Assert(_line != null, "Rendering line that has not been measured yet.");

            // Handle text trimming.
            System.Windows.Media.TextFormatting.TextLine line = _line;
            if (_line.HasOverflowed && _owner.ParagraphProperties.TextTrimming != TextTrimming.None)
            {
                line = _line.Collapse(GetCollapsingProps(_wrappingWidth, _owner.ParagraphProperties));
                Debug.Assert(line.HasCollapsed, "Line has not been collapsed");
            }

            double delta = CalculateXOffsetShift();

            line.Draw(ctx, new Point(lineOffset.X + delta, lineOffset.Y), (_mirror ? InvertAxes.Horizontal : InvertAxes.None));
        }