Adds support for pen width in eps input and canvas output, advances the eps reader but still cant fix all problems with the test image

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1885 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat
2011-09-01 12:51:27 +00:00
parent 26832a9a73
commit f8be3415b2
2 changed files with 9 additions and 3 deletions

View File

@ -81,6 +81,9 @@ type
ClipPath: TPath;
ClipMode: TvClipMode;
OverPrint: Boolean; // not used currently
//
PenWidth: Integer;
//
function Duplicate: TGraphicState;
end;
@ -1531,6 +1534,7 @@ begin
WriteLn('[TvEPSVectorialReader.ExecutePathConstructionOperator] newpath');
{$endif}
AData.SetClipPath(CurrentGraphicState.ClipPath, CurrentGraphicState.ClipMode);
AData.SetPenWidth(CurrentGraphicState.PenWidth);
AData.EndPath();
AData.StartPath();
@ -1692,8 +1696,8 @@ begin
begin
AData.SetPenStyle(psClear);
AData.EndPath();
//CurrentGraphicState.ClipPath := AData.GetPath(AData.GetPathCount()-1);
//CurrentGraphicState.ClipMode := vcmEvenOddRule;
CurrentGraphicState.ClipPath := AData.GetPath(AData.GetPathCount()-1);
CurrentGraphicState.ClipMode := vcmEvenOddRule;
Exit(True);
end
end;
@ -1781,6 +1785,7 @@ begin
if AToken.StrValue = 'setlinewidth' then
begin
Param1 := TPSToken(Stack.Pop);
CurrentGraphicState.PenWidth := Round(Param1.FloatValue);
Exit(True);
end;
// int setlinecap – Set shape of line ends for stroke (0 = butt,

View File

@ -169,7 +169,8 @@ begin
// Set the path Pen and Brush options
ADest.Pen.Style := CurPath.Pen.Style;
ADest.Pen.Width := CurPath.Pen.Width;
ADest.Pen.Width := Round(CurPath.Pen.Width * AMulX);
if ADest.Pen.Width < 1 then ADest.Pen.Width := 1;
ADest.Pen.FPColor := CurPath.Pen.Color;
ADest.Brush.FPColor := CurPath.Brush.Color;