summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/math/geometry.cpp2
-rw-r--r--platform/javascript/detect.py7
2 files changed, 8 insertions, 1 deletions
diff --git a/core/math/geometry.cpp b/core/math/geometry.cpp
index e0ead8446f..ada5107a2c 100644
--- a/core/math/geometry.cpp
+++ b/core/math/geometry.cpp
@@ -1158,7 +1158,7 @@ Vector<Vector<Point2> > Geometry::_polypath_offset(const Vector<Point2> &p_polyp
case END_SQUARE: et = etOpenSquare; break;
case END_ROUND: et = etOpenRound; break;
}
- ClipperOffset co;
+ ClipperOffset co(2.0, 0.25 * SCALE_FACTOR); // Defaults from ClipperOffset.
Path path;
// Need to scale points (Clipper's requirement for robust computation).
diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py
index c05b765c5e..7bf3e1bc1d 100644
--- a/platform/javascript/detect.py
+++ b/platform/javascript/detect.py
@@ -131,6 +131,13 @@ def configure(env):
env.Append(LINKFLAGS=['-s', 'BINARYEN=1'])
+ # This needs to be defined for Emscripten using 'fastcomp' (default pre-1.39.0)
+ # and undefined if using 'upstream'. And to make things simple, earlier
+ # Emscripten versions didn't include 'fastcomp' in their path, so we check
+ # against the presence of 'upstream' to conditionally add the flag.
+ if not "upstream" in em_config['EMSCRIPTEN_ROOT']:
+ env.Append(LINKFLAGS=['-s', 'BINARYEN_TRAP_MODE=\'clamp\''])
+
# Allow increasing memory buffer size during runtime. This is efficient
# when using WebAssembly (in comparison to asm.js) and works well for
# us since we don't know requirements at compile-time.