Skip to content

Commit 76fa070

Browse files
committed
Minor tweak to CMakeLists.txt (#754)
1 parent 348e9c4 commit 76fa070

File tree

4 files changed

+18
-17
lines changed

4 files changed

+18
-17
lines changed

CPP/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ endif ()
3131

3232
include(GNUInstallDirs)
3333
set(CLIPPER2_INC_FOLDER ${PROJECT_SOURCE_DIR}/Clipper2Lib/include/clipper2)
34-
configure_file(clipper.version.in ${CLIPPER2_INC_FOLDER}/clipper.version.h)
34+
configure_file(clipper.version.in
35+
${CLIPPER2_INC_FOLDER}/clipper.version.h NEWLINE_STYLE UNIX)
3536

3637
set(CLIPPER2_INC
3738
${CLIPPER2_INC_FOLDER}/clipper.h

CPP/Clipper2Lib/include/clipper2/clipper.core.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ namespace Clipper2Lib
730730
return Area<T>(poly) >= 0;
731731
}
732732

733-
#if CLIPPER2_HI_PRECISION
733+
#if CLIPPER2_HI_PRECISION
734734
// caution: this will compromise performance
735735
// https://github.com/AngusJohnson/Clipper2/issues/317#issuecomment-1314023253
736736
// See also CPP/BenchMark/GetIntersectPtBenchmark.cpp
@@ -756,9 +756,9 @@ namespace Clipper2Lib
756756
T bb1maxy = CC_MAX(ln2a.y, ln2b.y);
757757
T originx = (CC_MIN(bb0maxx, bb1maxx) + CC_MAX(bb0minx, bb1minx)) >> 1;
758758
T originy = (CC_MIN(bb0maxy, bb1maxy) + CC_MAX(bb0miny, bb1miny)) >> 1;
759-
double ln0c = (ln1dy * static_cast<double>(ln1a.x - originx)) +
759+
double ln0c = (ln1dy * static_cast<double>(ln1a.x - originx)) +
760760
(ln1dx * static_cast<double>(ln1a.y - originy));
761-
double ln1c = (ln2dy * static_cast<double>(ln2a.x - originx)) +
761+
double ln1c = (ln2dy * static_cast<double>(ln2a.x - originx)) +
762762
(ln2dx * static_cast<double>(ln2a.y - originy));
763763
double hitx = ((ln1dx * ln1c) - (ln2dx * ln0c)) / det;
764764
double hity = ((ln2dy * ln0c) - (ln1dy * ln1c)) / det;
@@ -774,7 +774,7 @@ namespace Clipper2Lib
774774
}
775775
return true;
776776
}
777-
#else
777+
#else
778778
template<typename T>
779779
inline bool GetIntersectPoint(const Point<T>& ln1a, const Point<T>& ln1b,
780780
const Point<T>& ln2a, const Point<T>& ln2b, Point<T>& ip)
@@ -788,7 +788,7 @@ namespace Clipper2Lib
788788
double det = dy1 * dx2 - dy2 * dx1;
789789
if (det == 0.0) return false;
790790
double t = ((ln1a.x - ln2a.x) * dy2 - (ln1a.y - ln2a.y) * dx2) / det;
791-
if (t <= 0.0) ip = ln1a;
791+
if (t <= 0.0) ip = ln1a;
792792
else if (t >= 1.0) ip = ln1b;
793793
else
794794
{

CPP/Clipper2Lib/include/clipper2/clipper.engine.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace Clipper2Lib {
3333

3434
//Note: all clipping operations except for Difference are commutative.
3535
enum class ClipType { None, Intersection, Union, Difference, Xor };
36-
36+
3737
enum class PathType { Subject, Clip };
3838
enum class JoinWith { None, Left, Right };
3939

@@ -106,7 +106,7 @@ namespace Clipper2Lib {
106106
//Important: UP and DOWN here are premised on Y-axis positive down
107107
//displays, which is the orientation used in Clipper's development.
108108
///////////////////////////////////////////////////////////////////
109-
109+
110110
struct Active {
111111
Point64 bot;
112112
Point64 top;
@@ -251,7 +251,7 @@ namespace Clipper2Lib {
251251
void JoinOutrecPaths(Active &e1, Active &e2);
252252
void FixSelfIntersects(OutRec* outrec);
253253
void DoSplitOp(OutRec* outRec, OutPt* splitOp);
254-
254+
255255
inline void AddTrialHorzJoin(OutPt* op);
256256
void ConvertHorzSegsToJoins();
257257
void ProcessHorzJoins();
@@ -331,7 +331,7 @@ namespace Clipper2Lib {
331331
unsigned lvl = Level();
332332
//Even levels except level 0
333333
return lvl && !(lvl & 1);
334-
}
334+
}
335335
};
336336

337337
typedef typename std::vector<std::unique_ptr<PolyPath64>> PolyPath64List;
@@ -420,7 +420,7 @@ namespace Clipper2Lib {
420420

421421
void SetScale(double value) { scale_ = value; }
422422
double Scale() const { return scale_; }
423-
423+
424424
PolyPathD* AddChild(const Path64& path) override
425425
{
426426
int error_code = 0;

CPP/Clipper2Lib/src/clipper.offset.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ int GetLowestClosedPathIdx(std::vector<Rect64>& boundsList)
6767
int i = -1, result = -1;
6868
Point64 botPt = Point64(INT64_MAX, INT64_MIN);
6969
for (const Rect64& r : boundsList)
70-
{
70+
{
7171
++i;
7272
if (!r.IsValid()) continue; // ignore invalid paths
7373
else if (r.bottom > botPt.y || (r.bottom == botPt.y && r.left < botPt.x))
@@ -103,7 +103,7 @@ inline double Hypot(double x, double y)
103103
}
104104

105105
inline PointD NormalizeVector(const PointD& vec)
106-
{
106+
{
107107
double h = Hypot(vec.x, vec.y);
108108
if (AlmostZero(h)) return PointD(0,0);
109109
double inverseHypot = 1 / h;
@@ -358,7 +358,7 @@ void ClipperOffset::OffsetPoint(Group& group, const Path64& path, size_t j, size
358358
// is concave
359359
path_out.push_back(GetPerpendic(path[j], norms[k], group_delta_));
360360
// this extra point is the only (simple) way to ensure that
361-
// path reversals are fully cleaned with the trailing clipper
361+
// path reversals are fully cleaned with the trailing clipper
362362
path_out.push_back(path[j]); // (#405)
363363
path_out.push_back(GetPerpendic(path[j], norms[j], group_delta_));
364364
}
@@ -394,7 +394,7 @@ void ClipperOffset::OffsetOpenJoined(Group& group, const Path64& path)
394394
OffsetPolygon(group, path);
395395
Path64 reverse_path(path);
396396
std::reverse(reverse_path.begin(), reverse_path.end());
397-
397+
398398
//rebuild normals // BuildNormals(path);
399399
std::reverse(norms.begin(), norms.end());
400400
norms.push_back(norms[0]);
@@ -408,7 +408,7 @@ void ClipperOffset::OffsetOpenPath(Group& group, const Path64& path)
408408
{
409409
// do the line start cap
410410
if (deltaCallback64_) group_delta_ = deltaCallback64_(path, norms, 0, 0);
411-
411+
412412
if (std::fabs(group_delta_) <= floating_point_tolerance)
413413
path_out.push_back(path[0]);
414414
else
@@ -426,7 +426,7 @@ void ClipperOffset::OffsetOpenPath(Group& group, const Path64& path)
426426
break;
427427
}
428428
}
429-
429+
430430
size_t highI = path.size() - 1;
431431
// offset the left side going forward
432432
for (Path64::size_type j = 1, k = 0; j < highI; k = j, ++j)

0 commit comments

Comments
 (0)