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