mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 19:29:34 +02:00
LazReport, cairo exporter, enable clipping for memo views
git-svn-id: trunk@41013 -
This commit is contained in:
parent
58b3af40f7
commit
589747856a
@ -74,6 +74,7 @@ type
|
||||
procedure ShowShape(View: TfrShapeView; x, y, h, w: integer);
|
||||
procedure OnText(X, Y: Integer; const Text: string; View: TfrView); override;
|
||||
procedure OnData(x, y: Integer; View: TfrView); override;
|
||||
procedure OnExported(x, y: Integer; View: TfrView); override;
|
||||
public
|
||||
property Backend: TlrCairoBackend read fBackend write fBackend;
|
||||
end;
|
||||
@ -786,6 +787,14 @@ begin
|
||||
|
||||
DataRect := Rect(nx, ny, nx+ndx, ny+ndy);
|
||||
|
||||
// enable global clipping only for this view classes
|
||||
// others classes might need clipping only in some cases or
|
||||
// may need another clipping shape.
|
||||
if
|
||||
(View is TfrMemoView)
|
||||
then
|
||||
SaveClipping(@DataRect);
|
||||
|
||||
if View is TfrShapeView then begin
|
||||
|
||||
ShowShape(TfrShapeView(View), nx, ny, ndy, ndx);
|
||||
@ -799,6 +808,11 @@ begin
|
||||
DefaultShowView(View, nx, ny, ndy, ndx);
|
||||
end;
|
||||
|
||||
procedure TlrCairoExportFilter.OnExported(x, y: Integer; View: TfrView);
|
||||
begin
|
||||
RestoreClipping;
|
||||
end;
|
||||
|
||||
initialization
|
||||
frRegisterExportFilter(TlrCairoExportFilter, 'Cairo Adobe Acrobat PDF (*.pdf)', '*.pdf');
|
||||
frRegisterExportFilter(TlrCairoExportFilter, 'Cairo Postscript (*.ps)', '*.ps');
|
||||
|
Loading…
Reference in New Issue
Block a user