mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-26 21:07:35 +01:00
LCL, fix postscript arc and ellipse drawing (avoid double frame)
git-svn-id: trunk@19027 -
This commit is contained in:
parent
cd1ecbf189
commit
4835e9c805
@ -102,6 +102,7 @@ Type
|
|||||||
procedure BrushChanging(APen: TObject); override;
|
procedure BrushChanging(APen: TObject); override;
|
||||||
procedure RegionChanging(APen: TObject); override;
|
procedure RegionChanging(APen: TObject); override;
|
||||||
procedure RequiredState(ReqState: TCanvasState); override;
|
procedure RequiredState(ReqState: TCanvasState); override;
|
||||||
|
procedure DoEllipseAndFill(const Bounds: TRect); override;
|
||||||
|
|
||||||
procedure BeginDoc; override;
|
procedure BeginDoc; override;
|
||||||
procedure EndDoc; override;
|
procedure EndDoc; override;
|
||||||
@ -871,6 +872,10 @@ begin
|
|||||||
// other states are anyway impossible, because handle is dummy
|
// other states are anyway impossible, because handle is dummy
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TPostScriptPrinterCanvas.DoEllipseAndFill(const Bounds: TRect);
|
||||||
|
begin
|
||||||
|
Ellipse(Bounds.Left, Bounds.Top, Bounds.Right, Bounds.Bottom);
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TPostScriptPrinterCanvas.Create(APrinter: TPrinter);
|
constructor TPostScriptPrinterCanvas.Create(APrinter: TPrinter);
|
||||||
begin
|
begin
|
||||||
@ -1543,14 +1548,14 @@ var xScale : Real;
|
|||||||
begin
|
begin
|
||||||
Changing;
|
Changing;
|
||||||
RequiredState([csHandleValid, csBrushValid, csPenValid]);
|
RequiredState([csHandleValid, csBrushValid, csPenValid]);
|
||||||
|
|
||||||
TranslateCoord(Left,Top);
|
TranslateCoord(Left,Top);
|
||||||
|
TranslateCoord(Right,Bottom);
|
||||||
|
|
||||||
//calculate centre of ellipse
|
//calculate centre of ellipse
|
||||||
cx:=Left;
|
cx:=(Left+Right)/2;
|
||||||
cy:=Top;
|
cy:=(Top+Bottom)/2;
|
||||||
rx:=Right-Left;
|
rx:=(Right-Left)/2;
|
||||||
ry:=Bottom-Top;
|
ry:=(Bottom-Top)/2;
|
||||||
|
|
||||||
if Angle2>=0 then
|
if Angle2>=0 then
|
||||||
Ang:='arc'
|
Ang:='arc'
|
||||||
@ -1558,13 +1563,12 @@ begin
|
|||||||
Ang:='arcn';
|
Ang:='arcn';
|
||||||
|
|
||||||
//calculate semi-minor and semi-major axes of ellipse
|
//calculate semi-minor and semi-major axes of ellipse
|
||||||
xScale:=Abs(rx);
|
xScale:=Abs((Right-Left)/2.0);
|
||||||
yScale:=Abs(ry);
|
yScale:=Abs((Bottom-Top)/2.0);
|
||||||
|
|
||||||
Code:=PPCFormat('matrix currentmatrix %.3f %.3f translate %.3f %.3f scale 0 0 1 %.3f %.3f %s setmatrix',
|
Code:=PPCFormat('matrix currentmatrix %.3f %.3f translate %.3f %.3f scale 0 0 1 %.3f %.3f %s setmatrix',
|
||||||
[cX,cY,xScale,yScale,Angle1/16,Angle2/16,ang]);
|
[cX,cY,xScale,yScale,Angle1/16,Angle2/16,ang]);
|
||||||
|
|
||||||
|
|
||||||
if (Pen.Color<>clNone) and ((Pen.Color<>Brush.Color) or (Brush.Style<>bsSolid)) then
|
if (Pen.Color<>clNone) and ((Pen.Color<>Brush.Color) or (Brush.Style<>bsSolid)) then
|
||||||
begin
|
begin
|
||||||
UpdateLineColor(clNone);
|
UpdateLineColor(clNone);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user