Skip to content

Commit

Permalink
Updated version to 1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
AngusJohnson committed Mar 26, 2023
1 parent 0c7fdf5 commit 756c507
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CPP/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.15)
project(Clipper2 VERSION 1.2.1 LANGUAGES C CXX)
project(Clipper2 VERSION 1.2.2 LANGUAGES C CXX)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_STANDARD 17)
Expand Down
4 changes: 2 additions & 2 deletions CPP/Clipper2Lib/include/clipper2/clipper.engine.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*******************************************************************************
* Author : Angus Johnson *
* Date : 2 March 2023 *
* Date : 26 March 2023 *
* Website : http://www.angusj.com *
* Copyright : Angus Johnson 2010-2023 *
* Purpose : This is the main polygon clipping module *
Expand All @@ -10,7 +10,7 @@
#ifndef CLIPPER_ENGINE_H
#define CLIPPER_ENGINE_H

constexpr auto CLIPPER2_VERSION = "1.2.1";
constexpr auto CLIPPER2_VERSION = "1.2.2";

#include <cstdlib>
#include <iostream>
Expand Down
10 changes: 5 additions & 5 deletions Delphi/Clipper2Lib/Clipper.Engine.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

(*******************************************************************************
* Author : Angus Johnson *
* Date : 17 March 2023 *
* Date : 26 March 2023 *
* Website : http://www.angusj.com *
* Copyright : Angus Johnson 2010-2023 *
* Purpose : This is the main polygon clipping module *
Expand Down Expand Up @@ -401,17 +401,17 @@ TPolyTreeD = class(TPolyPathD)
property Scale: double read FScale;
end;

resourcestring
rsClipper_PolyTreeErr = 'The TPolyTree parameter must be assigned.';
rsClipper_ClippingErr = 'Undefined clipping error';

implementation

//OVERFLOWCHECKS OFF is a necessary workaround for a compiler bug that very
//occasionally reports incorrect overflow errors in Delphi versions before 10.2.
//see https://forums.embarcadero.com/message.jspa?messageID=871444
{$OVERFLOWCHECKS OFF}

resourcestring
rsClipper_PolyTreeErr = 'The TPolyTree parameter must be assigned.';
rsClipper_ClippingErr = 'Undefined clipping error';

const
DefaultClipperDScale = 100;

Expand Down
14 changes: 8 additions & 6 deletions Delphi/Clipper2Lib/Clipper.Offset.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

(*******************************************************************************
* Author : Angus Johnson *
* Date : 22 March 2023 *
* Date : 26 March 2023 *
* Website : http://www.angusj.com *
* Copyright : Angus Johnson 2010-2023 *
* Purpose : Path Offset (Inflate/Shrink) *
Expand Down Expand Up @@ -88,7 +88,7 @@ TClipperOffset = class
joinType: TJoinType; endType: TEndType);
procedure Clear;
procedure Execute(delta: Double; out solution: TPaths64); overload;
procedure Execute(delta: Double; out polytree: TPolyTree64); overload;
procedure Execute(delta: Double; polytree: TPolyTree64); overload;

// MiterLimit: needed for mitered offsets (see offset_triginometry3.svg)
property MiterLimit: Double read fMiterLimit write fMiterLimit;
Expand Down Expand Up @@ -585,13 +585,16 @@ procedure TClipperOffset.Execute(delta: Double; out solution: TPaths64);
end;
//------------------------------------------------------------------------------

procedure TClipperOffset.Execute(delta: Double; out polytree: TPolyTree64);
procedure TClipperOffset.Execute(delta: Double; polytree: TPolyTree64);
var
i: integer;
group: TGroup;
dummy: TPaths64;
begin
fSolution := nil;
if not Assigned(polytree) then
Raise EClipper2LibException(rsClipper_PolyTreeErr);

ExecuteInternal(delta);

// clean up self-intersections ...
Expand Down Expand Up @@ -779,7 +782,7 @@ procedure TClipperOffset.DoRound(j, k: Integer; angle: double);
{$ELSE}
AddPoint(pt.X + offDist.X, pt.Y + offDist.Y);
{$ENDIF}
steps := Ceil(fStepsPerRad * abs(angle));
steps := Ceil(fStepsPerRad * abs(angle)); // #448, #456
for i := 2 to steps do
begin
offDist := PointD(offDist.X * fStepCos - fStepSin * offDist.Y,
Expand Down Expand Up @@ -821,8 +824,7 @@ procedure TClipperOffset.OffsetPoint(j: Integer; var k: integer);
if (cosA < 0.9998) then // greater than 1 degree (#424)
AddPoint(GetPerpendic(fInPath[j], fNorms[j], fGroupDelta)); // (#418)
end
else if (cosA > -0.99) and
(sinA * fGroupDelta < 0) then // is concave
else if (cosA > -0.99) and (sinA * fGroupDelta < 0) then // is concave
begin
AddPoint(GetPerpendic(fInPath[j], fNorms[k], fGroupDelta));
// this extra point is the only (simple) way to ensure that
Expand Down

0 comments on commit 756c507

Please sign in to comment.