fpvectorial: Fixes zoom in svg inside html table

git-svn-id: trunk@52409 -
This commit is contained in:
sekelsenmat 2016-05-30 08:36:01 +00:00
parent 91c8da3f8c
commit 596ea2bbc3
2 changed files with 14 additions and 6 deletions

View File

@ -2604,8 +2604,8 @@ begin
UpdateDocumentSize();
ALeft := X;
ATop := Y;
ARight := X + Document.Width;
ABottom := Y + Document.Height;
ARight := X + GetWidth();
ABottom := Y + GetHeight();
end;
procedure TvEmbeddedVectorialDoc.Render(ADest: TFPCustomCanvas;
@ -2634,12 +2634,17 @@ begin
lPage := Document.GetPage(0);
lPageHeight := Round(lPage.Height);
lPage.GetNaturalRenderPos(lPageHeight, lMulY);
UpdateDocumentSize();
lX_px := CoordToCanvasX(X);
lY_px := CoordToCanvasY(Y);
UpdateDocumentSize();
lWidth_px := Abs(lX_px - CoordToCanvasX(X+GetWidth()));
lHeight_px := Abs(lY_px - CoordToCanvasY(Y+GetHeight()));
// Ignore MulX/MulY here so that it doesn't affect AutoFit, this fixes an
// issue where embeded svg in html was getting out of proportion if the zoom
// was different than 1.0
// Calculate the standard zoom (zoom with mulx=1.0)
lWidth_px := Round(GetWidth());
lHeight_px := Round(GetHeight());
lPage.AutoFit(ADest, lWidth_px, lHeight_px, lHeight_px, lDeltaX, lDeltaY, lZoom);
lZoom := Abs(lZoom);
lX_px += lDeltaX;
@ -2648,6 +2653,9 @@ begin
begin
lY_px := lY_px + lHeight_px;
end;
// recalculate lWidth_px/height considering now mulx/muly
lWidth_px := Abs(CoordToCanvasX(GetWidth()));
lHeight_px := Abs(CoordToCanvasY(GetHeight()));
if ADoDraw then
begin

View File

@ -131,7 +131,7 @@ begin
FRSVG_CMD := ExtractFilePath(paramstr(0))+'rsvg-convert.exe';
{$endif}
{$if defined(Unix) and not defined(darwin)}
FRSVG_CMD := 'rsvg-convert';
FRSVG_CMD := '/usr/bin/rsvg-convert';
{$endif}
end;