fpvectorial: Fix rendering of wmf files in visualtest application.

This commit is contained in:
wp_xyz 2023-01-21 13:48:46 +01:00
parent dd4626b9ea
commit a3e63f4fa4
3 changed files with 9 additions and 4 deletions

View File

@ -4517,7 +4517,7 @@ begin
try try
ConvertPathToPolygons(tmpPath, ADestX, ADestY, AMulX, AMulY, polypoints, polystarts); ConvertPathToPolygons(tmpPath, ADestX, ADestY, AMulX, AMulY, polypoints, polystarts);
if (ADest is TCanvas) then if (ADest is TCanvas) then
TCanvas(ADest).Polygon(polypoints, WindingRule = vcmNonZeroWindingRule) TCanvas(ADest).Polygon(polypoints) //, WindingRule = vcmNonZeroWindingRule)
else else
ADest.Polygon(polypoints); ADest.Polygon(polypoints);
finally finally

View File

@ -291,6 +291,7 @@ begin
ShowWriteReadTestImages; ShowWriteReadTestImages;
UpdateCmdStates; UpdateCmdStates;
UpdateResultStates; UpdateResultStates;
UpdateTestResults;
end; end;
procedure TMainForm.PrepareDoc(var ADoc: TvVectorialDocument; procedure TMainForm.PrepareDoc(var ADoc: TvVectorialDocument;
@ -382,6 +383,7 @@ var
w, h: Integer; w, h: Integer;
fmt: TvVectorialFormat; fmt: TvVectorialFormat;
rc: TRenderCoords; rc: TRenderCoords;
factorX, factorY: Double;
begin begin
fmt := GetFileFormat; fmt := GetFileFormat;
@ -418,11 +420,13 @@ begin
end; end;
page := doc.GetPageAsVectorial(0); page := doc.GetPageAsVectorial(0);
factorX := w / page.Width;
factorY := h / page.Height;
page.DrawBackground(TPaintbox(Sender).Canvas); page.DrawBackground(TPaintbox(Sender).Canvas);
if page.UseTopLeftCoordinates then if page.UseTopLeftCoordinates then
page.Render(TPaintbox(Sender).Canvas, 0, 0, 1.0, 1.0) page.Render(TPaintbox(Sender).Canvas, 0, 0, factorX, factorY)
else else
page.Render(TPaintbox(Sender).Canvas, 0, h, 1.0, -1.0); page.Render(TPaintbox(Sender).Canvas, 0, h, factorX, -factorY);
end; end;
procedure TMainForm.ResultStateChange(Sender: TObject); procedure TMainForm.ResultStateChange(Sender: TObject);

View File

@ -197,7 +197,7 @@ begin
Width := 1; Width := 1;
end; end;
with FCurrBrush do begin with FCurrBrush do begin
Style := bsSolid; Style := bsClear; //Solid;
Color := colBlack; Color := colBlack;
end; end;
with FCurrFont do begin with FCurrFont do begin
@ -814,6 +814,7 @@ var
prevX, prevY: Word; prevX, prevY: Word;
begin begin
page := AData.AddPage(not (vrf_UseBottomLeftCoords in Settings.VecReaderFlags)); page := AData.AddPage(not (vrf_UseBottomLeftCoords in Settings.VecReaderFlags));
page.BackgroundColor := colWhite;
while AStream.Position < AStream.Size do begin while AStream.Position < AStream.Size do begin
// Store the stream position where the current record begins // Store the stream position where the current record begins