/// <summary> /// Draws the text layout. /// </summary> /// <param name="context">The drawing context.</param> /// <param name="origin">The origin.</param> public void Draw(DrawingContext context, Point origin) { if (!TextLines.Any()) { return; } var (currentX, currentY) = origin; foreach (var textLine in TextLines) { textLine.Draw(context, new Point(currentX + textLine.Start, currentY)); currentY += textLine.Height; } }
/// <summary> /// Draws the text layout. /// </summary> /// <param name="context">The drawing context.</param> /// <param name="origin">The origin.</param> public void Draw(IDrawingContextImpl context, Point origin) { if (!TextLines.Any()) { return; } var currentY = origin.Y; foreach (var textLine in TextLines) { textLine.Draw(context, new Point(origin.X, currentY)); currentY += textLine.LineMetrics.Size.Height; } }
/// <summary> /// Draws the text layout. /// </summary> /// <param name="context">The drawing context.</param> /// <param name="origin">The origin.</param> public void Draw(DrawingContext context, Point origin) { if (!TextLines.Any()) { return; } var currentY = origin.Y; foreach (var textLine in TextLines) { var offsetX = TextLine.GetParagraphOffsetX(textLine.LineMetrics.Size.Width, Size.Width, _paragraphProperties.TextAlignment); textLine.Draw(context, new Point(origin.X + offsetX, currentY)); currentY += textLine.LineMetrics.Size.Height; } }
/// <summary> /// Draws the text layout. /// </summary> /// <param name="context">The drawing context.</param> public void Draw(DrawingContext context) { if (!TextLines.Any()) { return; } var currentY = 0.0; foreach (var textLine in TextLines) { var offsetX = TextLine.GetParagraphOffsetX(textLine.LineMetrics.Size.Width, Size.Width, _paragraphProperties.TextAlignment); using (context.PushPostTransform(Matrix.CreateTranslation(offsetX, currentY))) { textLine.Draw(context); } currentY += textLine.LineMetrics.Size.Height; } }