mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 10:16:04 +02:00
LCL: Fix Delphi compatibility of PolyBezier (default value of Continuous argument). Issue #36442, patch by CudaText man).
git-svn-id: trunk@62404 -
This commit is contained in:
parent
6a3024178c
commit
07e7174b8d
@ -1105,10 +1105,10 @@ type
|
|||||||
StartX,StartY,EndX,EndY: Integer); virtual;
|
StartX,StartY,EndX,EndY: Integer); virtual;
|
||||||
procedure PolyBezier(Points: PPoint; NumPts: Integer;
|
procedure PolyBezier(Points: PPoint; NumPts: Integer;
|
||||||
Filled: boolean = False;
|
Filled: boolean = False;
|
||||||
Continuous: boolean = False); virtual; {$IFDEF HasFPCanvas1}reintroduce;{$ENDIF}
|
Continuous: boolean = True); virtual; {$IFDEF HasFPCanvas1}reintroduce;{$ENDIF}
|
||||||
procedure PolyBezier(const Points: array of TPoint;
|
procedure PolyBezier(const Points: array of TPoint;
|
||||||
Filled: boolean = False;
|
Filled: boolean = False;
|
||||||
Continuous: boolean = False); {$IFDEF HasFPCanvas1}reintroduce;{$ENDIF}
|
Continuous: boolean = True); {$IFDEF HasFPCanvas1}reintroduce;{$ENDIF}
|
||||||
procedure Polygon(const Points: array of TPoint;
|
procedure Polygon(const Points: array of TPoint;
|
||||||
Winding: Boolean;
|
Winding: Boolean;
|
||||||
StartIndex: Integer = 0;
|
StartIndex: Integer = 0;
|
||||||
|
@ -834,22 +834,25 @@ end;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
procedure TCanvas.PolyBezier(const Points: array of TPoint;
|
procedure TCanvas.PolyBezier(const Points: array of TPoint;
|
||||||
Filled: boolean = False;
|
Filled: boolean = False;
|
||||||
Continuous: boolean = False);
|
Continuous: boolean = True);
|
||||||
var NPoints, i: integer;
|
var NPoints, i: integer;
|
||||||
PointArray: ^TPoint;
|
PointArray: ^TPoint;
|
||||||
begin
|
begin
|
||||||
NPoints:=High(Points)-Low(Points)+1;
|
NPoints:=High(Points)-Low(Points)+1;
|
||||||
if NPoints<=0 then exit;
|
if NPoints<4 then exit; // Curve must have at least 4 points
|
||||||
GetMem(PointArray,SizeOf(TPoint)*NPoints);
|
GetMem(PointArray,SizeOf(TPoint)*NPoints);
|
||||||
for i:=0 to NPoints-1 do
|
try
|
||||||
PointArray[i]:=Points[i+Low(Points)];
|
for i:=0 to NPoints-1 do
|
||||||
PolyBezier(PointArray, NPoints, Filled, Continuous);
|
PointArray[i]:=Points[i+Low(Points)];
|
||||||
FreeMem(PointArray);
|
PolyBezier(PointArray, NPoints, Filled, Continuous);
|
||||||
|
finally
|
||||||
|
FreeMem(PointArray);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCanvas.PolyBezier(Points: PPoint; NumPts: Integer;
|
procedure TCanvas.PolyBezier(Points: PPoint; NumPts: Integer;
|
||||||
Filled: boolean = False;
|
Filled: boolean = False;
|
||||||
Continuous: boolean = False);
|
Continuous: boolean = True);
|
||||||
begin
|
begin
|
||||||
Changing;
|
Changing;
|
||||||
RequiredState([csHandleValid, csBrushValid, csPenValid]);
|
RequiredState([csHandleValid, csBrushValid, csPenValid]);
|
||||||
|
Loading…
Reference in New Issue
Block a user