To change rough.js for IE11
- Formatted code from debugger
- Ran through BabelJs
- Replace
**
with Math.pow, egx ** y
produces the same result as Math.pow(x,y) - Add 2 polyfills:
if (!Array.from) { Array.from = function (object) { 'use strict'; return [].slice.call(object); }; }
Math.imul = Math.imul || function(a, b) { var ah = (a >>> 16) & 0xffff; var al = a & 0xffff; var bh = (b >>> 16) & 0xffff; var bl = b & 0xffff; // the shift by 0 fixes the sign on the high part // the final |0 converts the unsigned value into a signed value return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0)|0); };
- Minify using java -jar ../../../../../etc/build/compiler.jar rough.js.modified >rough.min.js
- Used roughjs 4.4.1 from https://unpkg.com/roughjs@4.4.1/bundled/rough.js via https://www.npmjs.com/package/roughjs