mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 20:59:36 +02:00
LazUtils: Fix calculation error in function PolyBezierArcPoints (unit GraphMath). Issue #41400. Fix typos in comments.
This commit is contained in:
parent
1dcfd1a774
commit
1014cd330f
@ -1060,19 +1060,19 @@ end;
|
|||||||
Params: X, Y, Width, Height, Angle1, Angle2, Rotation, Points, Count
|
Params: X, Y, Width, Height, Angle1, Angle2, Rotation, Points, Count
|
||||||
Returns: Nothing
|
Returns: Nothing
|
||||||
|
|
||||||
Use PolyBezierArcPoints to convert an Agnle and AgnleLength into a
|
Use PolyBezierArcPoints to convert an arc between two angles Angle1 and Angle2
|
||||||
Pointer Array of TPoints for use with Polyline or Polygon.
|
into a pointer array of TPoints for use with Polyline or Polygon.
|
||||||
The Rotation parameter accepts a Rotation-Angle for a rotated Ellipse'- for
|
The Rotation parameter accepts a rotation angle for a rotated ellipse - for
|
||||||
a non-rotated ellipse this value would be 0, or 360*16.
|
a non-rotated ellipse this value would be 0, or 360*16.
|
||||||
The result is an Aproximation based on 1 or more Beziers. If the AngleLength
|
The result is an approximation based on 1 or more Beziers. If the angle length
|
||||||
is greater than 45*16 degrees, it recursively breaks the Arc into Arcs of
|
is greater than 45*16 degrees, it recursively breaks the arc into arcs of
|
||||||
45*16 degrees or less, and converts them into Beziers with BezierArcPoints.
|
45*16 degrees or less, and converts them into beziers with BezierArcPoints.
|
||||||
The angles are 1/16th of a degree. For example, a full circle equals
|
The angles are 1/16th of a degree. For example, a full circle equals
|
||||||
5760 (16*360).
|
5760 (16*360).
|
||||||
Positive values of Angle and AngleLength mean counter-clockwise while negative
|
Positive values of Angle1 and Angle2 mean counter-clockwise while negative
|
||||||
values mean clockwise direction. Zero degrees is at the 3'o clock position.
|
values mean clockwise direction. Zero degrees is at the 3'o clock position.
|
||||||
Points is automatically initialized, so any existing information is lost,
|
Points is automatically initialized, so any existing information is lost,
|
||||||
and the array starts at 0. Points should ALWAYS be Freed when done by calling
|
and the array starts at 0. Points should ALWAYS be freed when done by calling
|
||||||
to ReallocMem(Points, 0).
|
to ReallocMem(Points, 0).
|
||||||
|
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
@ -1087,8 +1087,6 @@ begin
|
|||||||
Angle2 := 360*16;
|
Angle2 := 360*16;
|
||||||
Angle1 := 0;
|
Angle1 := 0;
|
||||||
end;
|
end;
|
||||||
If Abs(Rotation) > 360*16 then
|
|
||||||
Rotation := Frac(Rotation / 360*16)*360*16;
|
|
||||||
FullAngle := Angle1 + Angle2;
|
FullAngle := Angle1 + Angle2;
|
||||||
K := Ceil(ABS(Angle2/16) / 45);
|
K := Ceil(ABS(Angle2/16) / 45);
|
||||||
Count := 0;
|
Count := 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user