fpvectorial: Fix text position when rendering svg files.

This commit is contained in:
wp_xyz 2023-01-18 00:15:39 +01:00
parent 2db4892771
commit 020d5d64ad
2 changed files with 7 additions and 1 deletions

View File

@ -5758,6 +5758,10 @@ begin
ABottom := Y;
end;
{ (X, Y) are the fpvectorial coordinatex of the left edge of the BASELINE (!)
of the first character box.
The character is painted, however, relative to the TOP/left corner of the
character box, in pixels. }
procedure TvText.Render(var ARenderInfo: TvRenderInfo; ADoDraw: Boolean);
const
LINE_SPACING = 0.2; // fraction of font height for line spacing
@ -5831,6 +5835,8 @@ begin
// ...
// We need to keep the order of lines drawing correct regardless of
// the drawing direction
// Since we have pixels now we need not take care about whether
// Page.TopLeftCoordinates is active or not!
curDimY := refPt.Y - (lTextSize.CY - lDescender);
// TvText supports multiple lines

View File

@ -3206,7 +3206,7 @@ begin
// text spans
lParagraph := TvParagraph.Create(AData);
lParagraph.YPos_NeedsAdjustment_DelFirstLineBodyHeight := True;
lParagraph.YPos_NeedsAdjustment_DelFirstLineBodyHeight := false; // wp: was True
lTextSpanStack := TSVGObjectStack.Create;
lCurStyle := TSVGTextSpanStyle.Create;
lTextSpanStack.Push(lCurStyle);