Rounding the resulting area in JavaScript instead of C++. It works better.