This commit is contained in:
2011-10-14 10:43:47 +00:00
parent 7af8870639
commit c04081d056
5 changed files with 48 additions and 0 deletions

View File

@@ -79,6 +79,18 @@ namespace Volian.Svg.Library
{
return _Scale * (y - YLowerLimit);
}
public float AbsX(SvgMeasurement x)
{
return x.GetSizeInPixels(DPI) + Svg.AbsoluteOffset.X;
}
public float AbsY(iTextSharp.text.pdf.PdfContentByte cb, SvgMeasurement y)
{
// the following line of code is 'taken' from the 16bit code: \promsnt\exe\wined\togdi.cpp
// whenever doing an 'Absolute' macro.
float yOffset = 54 * 4.8f + 0.5f; // yOffset starts in 'twips' (twip = 1/20 point)
yOffset = yOffset / 20; // convert from twips to points (point = 1/72 inch)
return cb.PdfDocument.PageSize.Height - y.GetSizeInPixels(DPI) + yOffset + Svg.AbsoluteOffset.Y;
}
public float Y(iTextSharp.text.pdf.PdfContentByte cb, float y)
{
return cb.PdfDocument.PageSize.Height - _Scale * (y - YLowerLimit);