mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 22:25:55 +08:00
Fixed Vojtech's out of boundary assert in Clipper library.
This commit is contained in:
parent
5b45777d4b
commit
0a202dcff3
@ -97,7 +97,8 @@ inline IType Round(double val)
|
|||||||
{
|
{
|
||||||
double v = FRound(val);
|
double v = FRound(val);
|
||||||
#if defined(CLIPPERLIB_INT32) && ! defined(NDEBUG)
|
#if defined(CLIPPERLIB_INT32) && ! defined(NDEBUG)
|
||||||
static constexpr const double hi = 65536 * 16383;
|
static_assert(sizeof(IType) == 4 || sizeof(IType) == 8, "IType must be int32 or int64");
|
||||||
|
static constexpr const double hi = 65536. * 16383. * (sizeof(IType) == 4 ? 1 : 65536. * 65536.);
|
||||||
if (v > hi || -v > hi)
|
if (v > hi || -v > hi)
|
||||||
throw clipperException("Coordinate outside allowed range");
|
throw clipperException("Coordinate outside allowed range");
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user