File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/*******************************************************************************
22* Author : Angus Johnson *
3- * Date : 17 April 2024 *
3+ * Date : 13 July 2024 *
44* Website : http://www.angusj.com *
55* Copyright : Angus Johnson 2010-2024 *
66* Purpose : Path Offset (Inflate/Shrink) *
@@ -513,8 +513,8 @@ private void BuildNormals(Path64 path)
513513 {
514514 int cnt = path . Count ;
515515 _normals . Clear ( ) ;
516+ if ( cnt == 0 ) return ;
516517 _normals . EnsureCapacity ( cnt ) ;
517-
518518 for ( int i = 0 ; i < cnt - 1 ; i ++ )
519519 _normals . Add ( GetUnitNormal ( path [ i ] , path [ i + 1 ] ) ) ;
520520 _normals . Add ( GetUnitNormal ( path [ cnt - 1 ] , path [ 0 ] ) ) ;
Original file line number Diff line number Diff line change 22
33(* ******************************************************************************
44* Author : Angus Johnson *
5- * Date : 17 April 2024 *
5+ * Date : 6 July 2024 *
66* Website : http://www.angusj.com *
77* Copyright : Angus Johnson 2010-2024 *
88* Purpose : Path Offset (Inflate/Shrink) *
@@ -236,9 +236,7 @@ function UnsafeGet(List: TList; Index: Integer): Pointer;
236236constructor TGroup.Create(const pathsIn: TPaths64; jt: TJoinType; et: TEndType);
237237var
238238 i, len: integer;
239- a: double;
240239 isJoined: boolean;
241- pb: PBoolean;
242240begin
243241 Self.joinType := jt;
244242 Self.endType := et;
@@ -345,7 +343,6 @@ procedure TClipperOffset.DoGroupOffset(group: TGroup);
345343 i,j, len, steps: Integer;
346344 r, stepsPer360, arcTol: Double;
347345 absDelta: double;
348- isShrinking: Boolean;
349346 rec: TRect64;
350347 pt0: TPoint64;
351348begin
@@ -450,6 +447,7 @@ procedure TClipperOffset.BuildNormals;
450447begin
451448 len := Length(fInPath);
452449 SetLength(fNorms, len);
450+ if len = 0 then Exit;
453451 for i := 0 to len-2 do
454452 fNorms[i] := GetUnitNormal(fInPath[i], fInPath[i+1 ]);
455453 fNorms[len -1 ] := GetUnitNormal(fInPath[len -1 ], fInPath[0 ]);
You can’t perform that action at this time.
0 commit comments