Clipper2 1.2.0 (#1083)

* Clipper2 1.2.0

* Update thirdparty/README.md [skip ci]
This commit is contained in:
aismann 2023-02-27 10:43:35 +01:00 committed by GitHub
parent d72d21de81
commit 9211db5232
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 15 deletions

View File

@ -37,7 +37,7 @@
## Clipper2
- [![Upstream](https://img.shields.io/github/v/tag/AngusJohnson/Clipper2?label=Upstream)](https://github.com/AngusJohnson/Clipper2)
- Version: git 1.1.1-df1c129
- Version: 1.2.0
- License: BSL-1.0
## ConvertUTF

View File

@ -1,6 +1,6 @@
/*******************************************************************************
* Author : Angus Johnson *
* Date : 28 January 2023 *
* Date : 26 February 2023 *
* Website : http://www.angusj.com *
* Copyright : Angus Johnson 2010-2023 *
* Purpose : This is the main polygon clipping module *
@ -10,7 +10,7 @@
#ifndef CLIPPER_ENGINE_H
#define CLIPPER_ENGINE_H
constexpr auto CLIPPER2_VERSION = "1.1.1";
constexpr auto CLIPPER2_VERSION = "1.2.0";
#include <cstdlib>
#include <iostream>

View File

@ -207,9 +207,7 @@ namespace Clipper2Lib {
{
if (rect.IsEmpty() || path.empty()) return Paths64();
class RectClip rc(rect);
Paths64 tmp;
tmp.push_back(path);
return rc.Execute(tmp, convex_only);
return rc.Execute(Paths64{ path }, convex_only);
}
inline PathsD RectClip(const RectD& rect,
@ -231,9 +229,7 @@ namespace Clipper2Lib {
inline PathsD RectClip(const RectD& rect,
const PathD& path, bool convex_only = false, int precision = 2)
{
PathsD tmp;
tmp.push_back(path);
return RectClip(rect, tmp, convex_only, precision);
return RectClip(rect, PathsD{ path }, convex_only, precision);
}
inline Paths64 RectClipLines(const Rect64& rect, const Paths64& lines)
@ -245,16 +241,12 @@ namespace Clipper2Lib {
inline Paths64 RectClipLines(const Rect64& rect, const Path64& line)
{
Paths64 tmp;
tmp.push_back(line);
return RectClipLines(rect, tmp);
return RectClipLines(rect, Paths64{ line });
}
inline PathsD RectClipLines(const RectD& rect, const PathD& line, int precision = 2)
{
PathsD tmp;
tmp.push_back(line);
return RectClip(rect, tmp, precision);
return RectClip(rect, PathsD{ line }, precision);
}
inline PathsD RectClipLines(const RectD& rect, const PathsD& lines, int precision = 2)