From 7af8870639216be55a527a43d835d6602e7b955a Mon Sep 17 00:00:00 2001 From: Kathy Date: Fri, 14 Oct 2011 10:41:13 +0000 Subject: [PATCH] --- PROMS/Volian.Svg.Library/iTextSharp.cs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/PROMS/Volian.Svg.Library/iTextSharp.cs b/PROMS/Volian.Svg.Library/iTextSharp.cs index c60e046a..0f8fd502 100644 --- a/PROMS/Volian.Svg.Library/iTextSharp.cs +++ b/PROMS/Volian.Svg.Library/iTextSharp.cs @@ -461,8 +461,16 @@ namespace Volian.Svg.Library cb.SetColorStroke(new Color(LineColor)); } cb.SetLineCap(PdfContentByte.LINE_CAP_ROUND); - cb.MoveTo(scale.X(X1), scale.Y(cb, Y1)); - cb.LineTo(scale.X(X2), scale.Y(cb, Y2)); + if (myParent is SvgGroup && (myParent as SvgGroup).Description.ToUpper() == "ABSOLUTE") + { + cb.MoveTo(scale.AbsX(X1), scale.AbsY(cb, Y1)); + cb.LineTo(scale.AbsX(X2), scale.AbsY(cb, Y2)); + } + else + { + cb.MoveTo(scale.X(X1), scale.Y(cb, Y1)); + cb.LineTo(scale.X(X2), scale.Y(cb, Y2)); + } cb.Stroke(); cb.RestoreState(); } @@ -511,7 +519,10 @@ namespace Volian.Svg.Library cb.SetLineWidth(scale.M(OutlineWidth)); cb.SetColorStroke(new Color(OutlineColor)); } - cb.Rectangle(scale.X(X), scale.Y(cb, Y), scale.M(Width), -scale.M(Height)); + if (myParent is SvgGroup && (myParent as SvgGroup).Description.ToUpper() == "ABSOLUTE") + cb.Rectangle(scale.AbsX(X), scale.AbsY(cb, Y), scale.M(Width), -scale.M(Height)); + else + cb.Rectangle(scale.X(X), scale.Y(cb, Y), scale.M(Width), -scale.M(Height)); SvgITextLibrary.StrokeAndFill(cb, stroke, fill); cb.RestoreState(); } @@ -574,7 +585,7 @@ namespace Volian.Svg.Library string text = mySvg.OnProcessText(Text, this, scale); if (text == string.Empty) return; SetupInheritance(myParent.MyInheritedSettings); - float yScale = scale.Y(cb, Y); + float yScale = (myParent is SvgGroup && (myParent as SvgGroup).Description.ToUpper() == "ABSOLUTE") ? scale.AbsY(cb, Y): scale.Y(cb, Y); cb.SaveState(); bool fill = FillColor != System.Drawing.Color.Transparent; bool stroke = OutlineWidth.Value != 0F && OutlineColor != System.Drawing.Color.Empty; @@ -591,7 +602,7 @@ namespace Volian.Svg.Library Phrase ph = BuildPhrase(text, fontSize, fontStyle, font); ColumnText ct = new ColumnText(cb); - float x = scale.X(X); + float x = (myParent is SvgGroup && (myParent as SvgGroup).Description.ToUpper() == "ABSOLUTE") ? scale.AbsX(X): scale.X(X); float w = 0; // chk.GetWidthPoint(); foreach (Chunk chk in ph.Chunks) w += chk.GetWidthPoint();