From 9053dd4675fdab69773fe694273e8dd9c7133e57 Mon Sep 17 00:00:00 2001 From: LingDong- Date: Mon, 21 Sep 2020 01:04:27 -0400 Subject: [PATCH] fix bg, use strict --- package.json | 3 ++- q5.js | 2 ++ q5.min.js | 2 +- tests.js | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4f6a79f..f1ae671 100644 --- a/package.json +++ b/package.json @@ -5,5 +5,6 @@ "repository": { "type": "git", "url": "git+https://github.com/LingDong-/q5xjs.git" - } + }, + "main": "q5.js" } diff --git a/q5.js b/q5.js index dda568c..6050625 100644 --- a/q5.js +++ b/q5.js @@ -1,4 +1,5 @@ function Q5(scope){ + "use strict"; return new graphics(scope); function graphics(scope){let $ = (scope == "global" ? window : this); $.canvas = document.createElement("canvas"); @@ -827,6 +828,7 @@ function Q5(scope){ } ctx.save(); ctx.resetTransform(); + ctx.scale($._pixelDensity,$._pixelDensity); if (typeof arguments[0] == "string"){ ctx.fillStyle = arguments[0]; }else{ diff --git a/q5.min.js b/q5.min.js index ee64b09..0d90feb 100644 --- a/q5.min.js +++ b/q5.min.js @@ -1 +1 @@ -function Q5(e){return new function e(t){let n="global"==t?window:this;n.canvas=document.createElement("canvas");let o=n.canvas.getContext("2d");n.width=100;n.height=100;n.canvas.width=n.width;n.canvas.height=n.height;"offscreen"!=t&&(document.body?document.body.appendChild(n.canvas):window.addEventListener("load",function(){document.body.appendChild(n.canvas)}));m();n.MAGIC=161533525;n.RGB=0;n.HSV=1;n.HSB=1;n.CHORD=0;n.PIE=1;n.OPEN=2;n.RADIUS=1;n.CORNER=2;n.CORNERS=3;n.ROUND="round";n.SQUARE="butt";n.PROJECT="square";n.MITER="miter";n.BEVEL="bevel";n.CLOSE=1;n.BLEND="source-over";n.REMOVE="destination-out";n.ADD="lighter";n.DARKEST="darken";n.LIGHTEST="lighten";n.DIFFERENCE="difference";n.SUBTRACT="subtract";n.EXCLUSION="exclusion";n.MULTIPLY="multiply";n.SCREEN="screen";n.REPLACE="copy";n.OVERLAY="overlay";n.HARD_LIGHT="hard-light";n.SOFT_LIGHT="soft-light";n.DODGE="color-dodge";n.BURN="color-burn";n.NORMAL="normal";n.ITALIC="italic";n.BOLD="bold";n.BOLDITALIC="italic bold";n.CENTER="center";n.LEFT="left";n.RIGHT="right";n.TOP="top";n.BOTTOM="bottom";n.BASELINE="alphabetic";n.LANDSCAPE="landscape";n.PORTRAIT="portrait";n.ALT=18;n.BACKSPACE=8;n.CONTROL=17;n.DELETE=46;n.DOWN_ARROW=40;n.ENTER=13;n.ESCAPE=27;n.LEFT_ARROW=37;n.OPTION=18;n.RETURN=13;n.RIGHT_ARROW=39;n.SHIFT=16;n.TAB=9;n.UP_ARROW=38;n.HALF_PI=Math.PI/2;n.PI=Math.PI;n.QUARTER_PI=Math.PI/4;n.TAU=2*Math.PI;n.TWO_PI=2*Math.PI;n.THRESHOLD=1;n.GRAY=2;n.OPAQUE=3;n.INVERT=4;n.POSTERIZE=5;n.DILATE=6;n.ERODE=7;n.BLUR=8;n.ARROW="default";n.CROSS="crosshair";n.HAND="pointer";n.MOVE="move";n.TEXT="text";n.VIDEO={video:!0,audio:!1};n.AUDIO={video:!1,audio:!0};n.SHR3=1;n.LCG=2;n.HARDWARE_FILTERS=!0;n.hint=function(e,t){n[e]=t};n.frameCount=0;n.mouseX=0;n.mouseY=0;n.pmouseX=0;n.pmouseY=0;n.mouseButton=null;n.keyIsPressed=!1;n.mouseIsPressed=!1;n.key=null;n.keyCode=null;n.pixels=null;n.accelerationX=0;n.accelerationY=0;n.accelerationZ=0;n.rotationX=0;n.rotationY=0;n.rotationZ=0;n.relRotationX=0;n.relRotationY=0;n.relRotationZ=0;n.pAccelerationX=0;n.pAccelerationY=0;n.pAccelerationZ=0;n.pRotationX=0;n.pRotationY=0;n.pRotationZ=0;n.pRelRotationX=0;n.pRelRotationY=0;n.pRelRotationZ=0;n.touches=[];n._colorMode=n.RGB;n._noStroke=!1;n._noFill=!1;n._ellipseMode=n.CENTER;n._rectMode=n.CORNER;n._curveDetail=20;n._curveAlpha=0;n._noLoop=!1;n._textFont="sans-serif";n._textSize=12;n._textLeading=12;n._textStyle="normal";n._pixelDensity=1;n._frameRate=null;n._tint=null;let a=null;let r=!0;let i=[];let l=null;let u=0;let s={};let c=0;let h=null;let f=null;let d=null;Object.defineProperty(n,"deviceOrientation",{get:function(){return 90==Math.abs(window.orientation)?n.LANDSCAPE:n.PORTRAIT}});Object.defineProperty(n,"windowWidth",{get:function(){return window.innerWidth}});Object.defineProperty(n,"windowHeight",{get:function(){return window.innerHeight}});Object.defineProperty(n,"drawingContext",{get:function(){return o}});n.createCanvas=function(e,t){n.width=e,n.height=t,n.canvas.width=e,n.canvas.height=t,m()};n.resizeCanvas=function(e,t){n.width=e,n.height=t,n.canvas.width=e,n.canvas.height=t};n.createGraphics=n.createImage=function(t,n){let o=new e("offscreen");return o.createCanvas(t,n),o.noLoop(),o};n.pixelDensity=function(e){return null==e?n._pixelDensity:(n._pixelDensity=e,n.canvas.width=Math.ceil(n.width*e),n.canvas.height=Math.ceil(n.height*e),n.canvas.style.width=n.width+"px",n.canvas.style.height=n.height+"px",o.scale(n._pixelDensity,n._pixelDensity),m(),n._pixelDensity)};n.map=function(e,t,n,o,a,r){let i=o+1*(e-t)/(n-t)*(a-o);return r?oe){let n=e/t;a.x*=n,a.y*=n,a.z*=n,r=e,i=e*e}return a},a.setMag=function(e){u();let t=r,n=e/t;return a.x*=n,a.y*=n,a.z*=n,r=e,i=e*e,a},a.heading=function(){return Math.atan2(a.y,a.x)},a.rotate=function(e){let t=Math.cos(e),n=Math.sin(e),o=a.x*t-a.y*n,r=a.x*n+a.y*t;return a.x=o,a.y=r,a},a.angleBetween=function(){let e=l.apply(null,arguments);const t=a.dot(e)/(a.mag()*e.mag());let n;return n=Math.acos(Math.min(1,Math.max(-1,t))),n*=Math.sign(a.cross(e).z||1)},a.lerp=function(e,t){return a.x=a.x*(1-t)+e.x*t,a.y=a.y*(1-t)+e.y*t,a.z=a.z*(1-t)+e.z*t,s(),a},a.reflect=function(e){return e.normalize(),a.sub(e.mult(2*a.dot(e)))},a.array=function(){return[a.x,a.y,a.z]},a.equals=function(e,t){return null==t&&null==(t=Number.EPSILON)&&(t=0),Math.abs(e.x-a.x)360&&(i=0),s=n*(1-t),c=n*(1-t*(u=(i/=60)-(l=~~i))),h=n*(1-t*(1-u)),l){case 0:o=n,a=h,r=s;break;case 1:o=c,a=n,r=s;break;case 2:o=s,a=n,r=h;break;case 3:o=s,a=c,r=n;break;case 4:o=h,a=s,r=n;break;default:o=n,a=s,r=c}return[255*o,255*a,255*r]}n.Color=function(e,t,n,o){let a=this;a.MAGIC=786698,a._r=e,a._g=t,a._b=n,a._a=o,a._h=0,a._s=0,a._v=0,a._hsvInferred=!1,a.setRed=function(e){a._r=e,a._hsvInferred=!1},a.setGreen=function(e){a._g=e,a._hsvInferred=!1},a.setBlue=function(e){a._b=e,a._hsvInferred=!1},a.setAlpha=function(e){a._a=e/255,a._hsvInferred=!1},a._inferHSV=function(){a._hsvInferred||([a._h,a._s,a._v]=function(e,t,n){let o,a,r,i,l;if(o=et?e>n?e:n:t>n?t:n)/255))return[r=0,i=0,l];if(0==(i=100*(a-o)/a))return[r=0,i,l];r=a==e?0+60*(t-n)/(a-o):a==t?120+60*(n-e)/(a-o):240+60*(e-t)/(a-o);return[r,i,l]}(a._r,a._g,a._b),a._hsvInferred=!0)},a.toString=function(){return`rgba(${Math.round(a._r)},${Math.round(a._g)},${Math.round(a._b)},${~~(1e3*a._a)/1e3})`}};n.colorMode=function(e){n._colorMode=e};n.color=function(){if(1==arguments.length&&786698==arguments[0].MAGIC)return arguments[0];if(n._colorMode==n.RGB){if(1==arguments.length)return new n.Color(arguments[0],arguments[0],arguments[0],1);if(2==arguments.length)return new n.Color(arguments[0],arguments[0],arguments[0],arguments[1]/255);if(3==arguments.length)return new n.Color(arguments[0],arguments[1],arguments[2],1);if(4==arguments.length)return new n.Color(arguments[0],arguments[1],arguments[2],arguments[3]/255)}else{if(1==arguments.length)return new n.Color(...p(0,0,arguments[0]/100),1);if(2==arguments.length)return new n.Color(...p(0,0,arguments[0]/100),arguments[1]/255);if(3==arguments.length)return new n.Color(...p(arguments[0],arguments[1]/100,arguments[2]/100),1);if(4==arguments.length)return new n.Color(...p(arguments[0],arguments[1]/100,arguments[2]/100),arguments[3])}return null};n.red=function(e){return e._r};n.green=function(e){return e._g};n.blue=function(e){return e._b};n.alpha=function(e){return 255*e._a};n.hue=function(e){return e._inferHSV(),e._h};n.saturation=function(e){return e._inferHSV(),e._s};n.brightness=function(e){return e._inferHSV(),e._v};n.lightness=function(e){return 100*(.2126*e._r+.7152*e._g+.0722*e._b)/255};n.lerpColor=function(e,t,o){return n._colorMode==n.RGB?new n.Color(n.constrain(n.lerp(e._r,t._r,o),0,255),n.constrain(n.lerp(e._g,t._g,o),0,255),n.constrain(n.lerp(e._b,t._b,o),0,255),n.constrain(n.lerp(e._a,t._a,o),0,1)):(e._inferHSV(),t._inferHSV(),new n.Color(n.constrain(function(e,t,o){var a=[[Math.abs(t-e),n.map(o,0,1,e,t)],[Math.abs(t+360-e),n.map(o,0,1,e,t+360)],[Math.abs(t-360-e),n.map(o,0,1,e,t-360)]];return a.sort((e,t)=>e[0]-t[0]),(a[0][1]+720)%360}(e._h,t._h,o),0,360),n.constrain(n.lerp(e._s,t._s,o),0,100),n.constrain(n.lerp(e._v,t._v,o),0,100),n.constrain(n.lerp(e._a,t._a,o),0,1)))};function m(){o.fillStyle="white",o.strokeStyle="black",o.lineCap="round",o.lineJoin="miter"}n.strokeWeight=function(e){n._noStroke=!1,o.lineWidth=e};n.stroke=function(){if(n._noStroke=!1,"string"==typeof arguments[0])return void(o.strokeStyle=arguments[0]);let e=n.color.apply(null,arguments);e._a<=0?n._noStroke=!0:o.strokeStyle=e};n.noStroke=function(){n._noStroke=!0};n.fill=function(){if(n._noFill=!1,"string"==typeof arguments[0])return void(o.fillStyle=arguments[0]);let e=n.color.apply(null,arguments);e._a<=0?n._noFill=!0:o.fillStyle=e};n.noFill=function(){n._noFill=!0};n.blendMode=function(e){o.globalCompositeOperation=e};n.strokeCap=function(e){o.lineCap=e};n.strokeJoin=function(e){o.lineJoin=e};n.ellipseMode=function(e){n._ellipseMode=e};n.rectMode=function(e){n._rectMode=e};n.curveDetail=function(e){n._curveDetail=e};n.curveAlpha=function(e){n._curveAlpha=e};n.curveTightness=function(e){console.warn("curveTightness() sets the 'alpha' parameter of Catmull-Rom curve, and is NOT identical to p5.js counterpart. As this might change in the future, please call curveAlpha() directly."),n._curveAlpha=e};n.clear=function(){o.clearRect(0,0,n.width,n.height)};n.background=function(){if(arguments[0]&&arguments[0].MAGIC==n.MAGIC)return n.image(arguments[0],0,0,n.width,n.height);o.save(),o.resetTransform(),"string"==typeof arguments[0]?o.fillStyle=arguments[0]:o.fillStyle=n.color(...Array.from(arguments)),o.fillRect(0,0,n.width,n.height),o.restore()};n.line=function(e,t,a,r){n._noStroke||(o.beginPath(),o.moveTo(e,t),o.lineTo(a,r),o.stroke())};function g(e){if(0<=e&&e<2*Math.PI)return e;for(;e<0;)e+=2*Math.PI;for(;e>=Math.PI;)e-=2*Math.PI;return e}function v(e,t,a,r,i,l,u,s){if(n._noFill&&n._noStroke)return;let c=g(i),h=g(l);o.beginPath();for(let i=0;i0?(m[e]=1,m[e+1]=0):(m[e]=0,m[e+1]=1));let g=e*m[0]+n*m[1],v=t*m[0]+o*m[1],M=n*m[2]+a*m[3],_=o*m[2]+r*m[3],x=a*m[4]+i*m[5],y=r*m[4]+l*m[5],w=g*m[6]+M*m[7],R=v*m[6]+_*m[7],I=M*m[8]+x*m[9],E=_*m[8]+y*m[9],S=w*m[2]+I*m[3],C=R*m[2]+E*m[3];h.push([S,C])}return h}(...a,...l,...u,...s,n._curveDetail,n._curveAlpha);for(let e=0;e=t?255:0}};y[n.GRAY]=function(e){for(let t=0;t>8)/n,e[o+1]=255*(e[o+1]*t>>8)/n,e[o+2]=255*(e[o+2]*t>>8)/n};y[n.DILATE]=function(e){R(),d.set(e);let[t,n]=[o.canvas.width,o.canvas.height];for(let o=0;o=1&&(s++,f--),(d*=2)>=1&&(c++,d--),(p*=2)>=1&&(h++,p--)}return m};n.noiseDetail=function(e,t){e>0&&(E=e),t>0&&(S=t)};const T=function(){let e,t,n=4294967295;return{setSeed(o){e=t=(null==o?Math.random()*n:o)>>>0},getSeed:()=>t,rand:()=>(e^=e<<17,e^=e>>13,((e^=e<<5)>>>0)/n)}};let D=T();D.setSeed();n.noiseSeed=function(e){let t=null==e?4294967295*Math.random():e;A||(A=new Float32Array(4096));for(var n=0;n<4096;n++)t^=t<<17,t^=t>>13,t^=t<<5,A[n]=(t>>>0)/4294967295};n.randomSeed=function(e){D.setSeed(e)};n.random=function(e,t){return null==e?D.rand():"number"==typeof e?null!=t?D.rand()*(t-e)+e:D.rand()*e:e[~~(e.length*D.rand())]};n.randomGenerator=function(e){e==n.LCG?D=function(){const e=4294967296;let t,n;return{setSeed(o){n=t=(null==o?Math.random()*e:o)>>>0},getSeed:()=>t,rand:()=>(n=(1664525*n+1013904223)%e)/e}}():e==n.SHR3&&(D=T()),D.setSeed()};var P=new function(){var e,t,n,o=new Array(128),a=new Array(256),r=new Array(128),i=new Array(128),l=new Array(256),u=new Array(256),s=function(){return 4294967296*D.rand()-2147483648},c=function(){return.5+2.328306e-10*(s()<<0)},h=function(){for(var t,a,l,u,h=3.44262;;){if(t=n*r[e],0==e){do{l=c(),u=c(),t=.2904764*-Math.log(l),a=-Math.log(u)}while(a+a0?h+t:-h-t}if(i[e]+c()*(i[e-1]-i[e])>>0)=1;t--)c=Math.sqrt(-2*Math.log(f/c+Math.exp(-.5*c*c))),o[t+1]=Math.floor(c/h*n),h=c,i[t]=Math.exp(-.5*c*c),r[t]=c/n;for(e=m/Math.exp(-d),a[0]=Math.floor(d/e*s),a[1]=0,l[0]=e/s,l[255]=d/s,u[0]=1,u[255]=Math.exp(-d),t=254;t>=1;t--)d=-Math.log(m/d+Math.exp(-d)),a[t+1]=Math.floor(d/p*s),p=d,u[t]=Math.exp(-d),l[t]=d/s}};P.hasInit=!1;n.randomGaussian=function(e,t){return P.hasInit||(P.zigset(),P.hasInit=!0),P.RNOR()*t+e};n.randomExponential=function(){return P.hasInit||(P.zigset(),P.hasInit=!0),P.REXP()};n.print=console.log;n.cursor=function(e,t,o){let a="";e.includes(".")&&(e=`url("${e}")`,a=", auto"),null!=t&&(e+=" "+t+" "+o),n.canvas.style.cursor=e+a};n.noCursor=function(){n.canvas.style.cursor="none"};n.createCapture=function(e){var t=document.createElement("video");return t.playsinline="playsinline",t.autoplay="autoplay",navigator.mediaDevices.getUserMedia(e).then(function(e){t.srcObject=e}),t.style.position="absolute",t.style.opacity=1e-5,t.style.zIndex=-1e3,document.body.appendChild(t),t};let b=["setup","draw","preload","mouseMoved","mousePressed","mouseReleased","mouseDragged","mouseClicked","keyPressed","keyReleased","keyTyped","touchStarted","touchEnded"];for(let e of b){let t="_"+e+"Fn";n[t]=function(){},n[t].isPlaceHolder=!0,n[e]?n[t]=n[e]:Object.defineProperty(n,e,{set:function(e){n[t]=e}})}function z(){n._noLoop||(a=null==n._frameRate?requestAnimationFrame(z):setTimeout(z,1e3/n._frameRate)),x(),r=!0,o.save(),n._drawFn(),o.restore(),n.frameCount++}n.noLoop=function(){n._noLoop=!0,a=null};n.loop=function(){n._noLoop=!1,null==a&&z()};n.redraw=function(){z()};n.frameRate=function(e){n._frameRate=e};setTimeout(function(){n._preloadFn(),c=window.performance.now(),function e(){if(u>0)return setTimeout(e,10);n._setupFn();z()}()},1);n.canvas.onmousemove=function(e){n.pmouseX=n.mouseX,n.pmouseY=n.mouseY,n.mouseX=e.offsetX,n.mouseY=e.offsetY,n.mouseIsPressed?n._mouseDraggedFn(e):n._mouseMovedFn(e)};n.canvas.onmousedown=function(e){n.pmouseX=n.mouseX,n.pmouseY=n.mouseY,n.mouseX=e.offsetX,n.mouseY=e.offsetY,n.mouseIsPressed=!0,n.mouseButton=[n.LEFT,n.CENTER,n.RIGHT][e.button],n._mousePressedFn(e)};n.canvas.onmouseup=function(e){n.pmouseX=n.mouseX,n.pmouseY=n.mouseY,n.mouseX=e.offsetX,n.mouseY=e.offsetY,n.mouseIsPressed=!1,n._mouseReleasedFn(e)};n.canvas.onclick=function(e){n.pmouseX=n.mouseX,n.pmouseY=n.mouseY,n.mouseX=e.offsetX,n.mouseY=e.offsetY,n.mouseIsPressed=!0,n._mouseClickedFn(e),n.mouseIsPressed=!1};window.addEventListener("keydown",function(e){n.keyIsPressed=!0,n.key=e.key,n.keyCode=e.keyCode,s[n.keyCode]=!0,n._keyPressedFn(e),1==e.key.length&&n._keyTypedFn(e)});window.addEventListener("keyup",function(e){n.keyIsPressed=!1,n.key=e.key,n.keyCode=e.keyCode,s[n.keyCode]=!1,n._keyReleasedFn(e)});n.keyIsDown=function(e){return!!s[e]};function O(e){const t=n.canvas.getBoundingClientRect(),o=n.canvas.scrollWidth/n.width||1,a=n.canvas.scrollHeight/n.height||1;return{x:(e.clientX-t.left)/o,y:(e.clientY-t.top)/a,id:e.identifier}}function k(){return n._touchStarted.isPlaceHolder&&n._touchMoved.isPlaceHolder&&n._touchEnded.isPlaceHolder}n.canvas.ontouchstart=function(e){n.touches=e.touches.map(O),k()&&(n.pmouseX=n.mouseX,n.pmouseY=n.mouseY,n.mouseX=n.touches[0].x,n.mouseY=n.touches[0].y,n.mouseIsPressed=!0,n.mouseButton=n.LEFT,n._mousePressedFn(e)||e.preventDefault()),n._touchStartedFn(e)||e.preventDefault()};n.canvas.ontouchmove=function(e){n.touches=e.touches.map(O),k()&&(n.pmouseX=n.mouseX,n.pmouseY=n.mouseY,n.mouseX=n.touches[0].x,n.mouseY=n.touches[0].y,n.mouseIsPressed=!0,n.mouseButton=n.LEFT,n._mouseDraggedFn(e)||e.preventDefault()),n._touchMovedFn(e)||e.preventDefault()};n.canvas.ontouchend=n.canvas.ontouchcancel=function(e){n.touches=e.touches.map(O),k()&&(n.pmouseX=n.mouseX,n.pmouseY=n.mouseY,n.mouseX=n.touches[0].x,n.mouseY=n.touches[0].y,n.mouseIsPressed=!1,n._mouseReleasedFn(e)||e.preventDefault()),n._touchEndedFn(e)||e.preventDefault()};n.hasSensorPermission=!window.DeviceOrientationEvent&&!window.DeviceMotionEvent||!(DeviceOrientationEvent.requestPermission||DeviceMotionEvent.requestPermission);n.requestSensorPermissions=function(){DeviceOrientationEvent.requestPermission&&DeviceOrientationEvent.requestPermission().then(e=>{"granted"==e&&DeviceMotionEvent.requestPermission&&DeviceMotionEvent.requestPermission().then(e=>{"granted"==e&&(n.hasSensorPermission=!0)}).catch(alert)}).catch(alert)};window.ondeviceorientation=function(e){n.pRotationX=n.rotationX,n.pRotationY=n.rotationY,n.pRotationZ=n.rotationZ,n.pRelRotationX=n.relRotationX,n.pRelRotationY=n.relRotationY,n.pRelRotationZ=n.relRotationZ,n.rotationX=e.beta*(Math.PI/180),n.rotationY=e.gamma*(Math.PI/180),n.rotationZ=e.alpha*(Math.PI/180),n.relRotationX=[-n.rotationY,-n.rotationX,n.rotationY][1+~~(window.orientation/90)],n.relRotationY=[-n.rotationX,n.rotationY,n.rotationX][1+~~(window.orientation/90)],n.relRotationZ=n.rotationZ};window.ondevicemotion=function(e){if(n.pAccelerationX=n.accelerationX,n.pAccelerationY=n.accelerationY,n.pAccelerationZ=n.accelerationZ,!e.acceleration){let t=((e,t)=>[(e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3])/(e[12]*t[0]+e[13]*t[1]+e[14]*t[2]+e[15]),(e[4]*t[0]+e[5]*t[1]+e[6]*t[2]+e[7])/(e[12]*t[0]+e[13]*t[1]+e[14]*t[2]+e[15]),(e[8]*t[0]+e[9]*t[1]+e[10]*t[2]+e[11])/(e[12]*t[0]+e[13]*t[1]+e[14]*t[2]+e[15])])(((e,t)=>[e[0]*t[0]+e[1]*t[4]+e[2]*t[8]+e[3]*t[12],e[0]*t[1]+e[1]*t[5]+e[2]*t[9]+e[3]*t[13],e[0]*t[2]+e[1]*t[6]+e[2]*t[10]+e[3]*t[14],e[0]*t[3]+e[1]*t[7]+e[2]*t[11]+e[3]*t[15],e[4]*t[0]+e[5]*t[4]+e[6]*t[8]+e[7]*t[12],e[4]*t[1]+e[5]*t[5]+e[6]*t[9]+e[7]*t[13],e[4]*t[2]+e[5]*t[6]+e[6]*t[10]+e[7]*t[14],e[4]*t[3]+e[5]*t[7]+e[6]*t[11]+e[7]*t[15],e[8]*t[0]+e[9]*t[4]+e[10]*t[8]+e[11]*t[12],e[8]*t[1]+e[9]*t[5]+e[10]*t[9]+e[11]*t[13],e[8]*t[2]+e[9]*t[6]+e[10]*t[10]+e[11]*t[14],e[8]*t[3]+e[9]*t[7]+e[10]*t[11]+e[11]*t[15],e[12]*t[0]+e[13]*t[4]+e[14]*t[8]+e[15]*t[12],e[12]*t[1]+e[13]*t[5]+e[14]*t[9]+e[15]*t[13],e[12]*t[2]+e[13]*t[6]+e[14]*t[10]+e[15]*t[14],e[12]*t[3]+e[13]*t[7]+e[14]*t[11]+e[15]*t[15]])((e=>[Math.cos(e),0,Math.sin(e),0,0,1,0,0,-Math.sin(e),0,Math.cos(e),0,0,0,0,1])(n.rotationY),(e=>[1,0,0,0,0,Math.cos(e),-Math.sin(e),0,0,Math.sin(e),Math.cos(e),0,0,0,0,1])(n.rotationX)),[0,0,-9.80665]);n.accelerationX=e.accelerationIncludingGravity.x+t[0],n.accelerationY=e.accelerationIncludingGravity.y+t[1],n.accelerationZ=e.accelerationIncludingGravity.z-t[2]}};n.year=function(){return(new Date).getFullYear()};n.day=function(){return(new Date).getDay()};n.hour=function(){return(new Date).getHours()};n.minute=function(){return(new Date).getMinutes()};n.second=function(){return(new Date).getSeconds()};n.millis=function(){return window.performance.now()-c}}(e)} \ No newline at end of file +function Q5(e){"use strict";return new function e(t){let n="global"==t?window:this;n.canvas=document.createElement("canvas");let o=n.canvas.getContext("2d");n.width=100;n.height=100;n.canvas.width=n.width;n.canvas.height=n.height;"offscreen"!=t&&(document.body?document.body.appendChild(n.canvas):window.addEventListener("load",function(){document.body.appendChild(n.canvas)}));m();n.MAGIC=161533525;n.RGB=0;n.HSV=1;n.HSB=1;n.CHORD=0;n.PIE=1;n.OPEN=2;n.RADIUS=1;n.CORNER=2;n.CORNERS=3;n.ROUND="round";n.SQUARE="butt";n.PROJECT="square";n.MITER="miter";n.BEVEL="bevel";n.CLOSE=1;n.BLEND="source-over";n.REMOVE="destination-out";n.ADD="lighter";n.DARKEST="darken";n.LIGHTEST="lighten";n.DIFFERENCE="difference";n.SUBTRACT="subtract";n.EXCLUSION="exclusion";n.MULTIPLY="multiply";n.SCREEN="screen";n.REPLACE="copy";n.OVERLAY="overlay";n.HARD_LIGHT="hard-light";n.SOFT_LIGHT="soft-light";n.DODGE="color-dodge";n.BURN="color-burn";n.NORMAL="normal";n.ITALIC="italic";n.BOLD="bold";n.BOLDITALIC="italic bold";n.CENTER="center";n.LEFT="left";n.RIGHT="right";n.TOP="top";n.BOTTOM="bottom";n.BASELINE="alphabetic";n.LANDSCAPE="landscape";n.PORTRAIT="portrait";n.ALT=18;n.BACKSPACE=8;n.CONTROL=17;n.DELETE=46;n.DOWN_ARROW=40;n.ENTER=13;n.ESCAPE=27;n.LEFT_ARROW=37;n.OPTION=18;n.RETURN=13;n.RIGHT_ARROW=39;n.SHIFT=16;n.TAB=9;n.UP_ARROW=38;n.HALF_PI=Math.PI/2;n.PI=Math.PI;n.QUARTER_PI=Math.PI/4;n.TAU=2*Math.PI;n.TWO_PI=2*Math.PI;n.THRESHOLD=1;n.GRAY=2;n.OPAQUE=3;n.INVERT=4;n.POSTERIZE=5;n.DILATE=6;n.ERODE=7;n.BLUR=8;n.ARROW="default";n.CROSS="crosshair";n.HAND="pointer";n.MOVE="move";n.TEXT="text";n.VIDEO={video:!0,audio:!1};n.AUDIO={video:!1,audio:!0};n.SHR3=1;n.LCG=2;n.HARDWARE_FILTERS=!0;n.hint=function(e,t){n[e]=t};n.frameCount=0;n.mouseX=0;n.mouseY=0;n.pmouseX=0;n.pmouseY=0;n.mouseButton=null;n.keyIsPressed=!1;n.mouseIsPressed=!1;n.key=null;n.keyCode=null;n.pixels=null;n.accelerationX=0;n.accelerationY=0;n.accelerationZ=0;n.rotationX=0;n.rotationY=0;n.rotationZ=0;n.relRotationX=0;n.relRotationY=0;n.relRotationZ=0;n.pAccelerationX=0;n.pAccelerationY=0;n.pAccelerationZ=0;n.pRotationX=0;n.pRotationY=0;n.pRotationZ=0;n.pRelRotationX=0;n.pRelRotationY=0;n.pRelRotationZ=0;n.touches=[];n._colorMode=n.RGB;n._noStroke=!1;n._noFill=!1;n._ellipseMode=n.CENTER;n._rectMode=n.CORNER;n._curveDetail=20;n._curveAlpha=0;n._noLoop=!1;n._textFont="sans-serif";n._textSize=12;n._textLeading=12;n._textStyle="normal";n._pixelDensity=1;n._frameRate=null;n._tint=null;let a=null;let r=!0;let i=[];let l=null;let u=0;let s={};let c=0;let h=null;let f=null;let d=null;Object.defineProperty(n,"deviceOrientation",{get:function(){return 90==Math.abs(window.orientation)?n.LANDSCAPE:n.PORTRAIT}});Object.defineProperty(n,"windowWidth",{get:function(){return window.innerWidth}});Object.defineProperty(n,"windowHeight",{get:function(){return window.innerHeight}});Object.defineProperty(n,"drawingContext",{get:function(){return o}});n.createCanvas=function(e,t){n.width=e,n.height=t,n.canvas.width=e,n.canvas.height=t,m()};n.resizeCanvas=function(e,t){n.width=e,n.height=t,n.canvas.width=e,n.canvas.height=t};n.createGraphics=n.createImage=function(t,n){let o=new e("offscreen");return o.createCanvas(t,n),o.noLoop(),o};n.pixelDensity=function(e){return null==e?n._pixelDensity:(n._pixelDensity=e,n.canvas.width=Math.ceil(n.width*e),n.canvas.height=Math.ceil(n.height*e),n.canvas.style.width=n.width+"px",n.canvas.style.height=n.height+"px",o.scale(n._pixelDensity,n._pixelDensity),m(),n._pixelDensity)};n.map=function(e,t,n,o,a,r){let i=o+1*(e-t)/(n-t)*(a-o);return r?oe){let n=e/t;a.x*=n,a.y*=n,a.z*=n,r=e,i=e*e}return a},a.setMag=function(e){u();let t=r,n=e/t;return a.x*=n,a.y*=n,a.z*=n,r=e,i=e*e,a},a.heading=function(){return Math.atan2(a.y,a.x)},a.rotate=function(e){let t=Math.cos(e),n=Math.sin(e),o=a.x*t-a.y*n,r=a.x*n+a.y*t;return a.x=o,a.y=r,a},a.angleBetween=function(){let e=l.apply(null,arguments);const t=a.dot(e)/(a.mag()*e.mag());let n;return n=Math.acos(Math.min(1,Math.max(-1,t))),n*=Math.sign(a.cross(e).z||1)},a.lerp=function(e,t){return a.x=a.x*(1-t)+e.x*t,a.y=a.y*(1-t)+e.y*t,a.z=a.z*(1-t)+e.z*t,s(),a},a.reflect=function(e){return e.normalize(),a.sub(e.mult(2*a.dot(e)))},a.array=function(){return[a.x,a.y,a.z]},a.equals=function(e,t){return null==t&&null==(t=Number.EPSILON)&&(t=0),Math.abs(e.x-a.x)360&&(i=0),s=n*(1-t),c=n*(1-t*(u=(i/=60)-(l=~~i))),h=n*(1-t*(1-u)),l){case 0:o=n,a=h,r=s;break;case 1:o=c,a=n,r=s;break;case 2:o=s,a=n,r=h;break;case 3:o=s,a=c,r=n;break;case 4:o=h,a=s,r=n;break;default:o=n,a=s,r=c}return[255*o,255*a,255*r]}n.Color=function(e,t,n,o){let a=this;a.MAGIC=786698,a._r=e,a._g=t,a._b=n,a._a=o,a._h=0,a._s=0,a._v=0,a._hsvInferred=!1,a.setRed=function(e){a._r=e,a._hsvInferred=!1},a.setGreen=function(e){a._g=e,a._hsvInferred=!1},a.setBlue=function(e){a._b=e,a._hsvInferred=!1},a.setAlpha=function(e){a._a=e/255,a._hsvInferred=!1},a._inferHSV=function(){a._hsvInferred||([a._h,a._s,a._v]=function(e,t,n){let o,a,r,i,l;if(o=et?e>n?e:n:t>n?t:n)/255))return[r=0,i=0,l];if(0==(i=100*(a-o)/a))return[r=0,i,l];r=a==e?0+60*(t-n)/(a-o):a==t?120+60*(n-e)/(a-o):240+60*(e-t)/(a-o);return[r,i,l]}(a._r,a._g,a._b),a._hsvInferred=!0)},a.toString=function(){return`rgba(${Math.round(a._r)},${Math.round(a._g)},${Math.round(a._b)},${~~(1e3*a._a)/1e3})`}};n.colorMode=function(e){n._colorMode=e};n.color=function(){if(1==arguments.length&&786698==arguments[0].MAGIC)return arguments[0];if(n._colorMode==n.RGB){if(1==arguments.length)return new n.Color(arguments[0],arguments[0],arguments[0],1);if(2==arguments.length)return new n.Color(arguments[0],arguments[0],arguments[0],arguments[1]/255);if(3==arguments.length)return new n.Color(arguments[0],arguments[1],arguments[2],1);if(4==arguments.length)return new n.Color(arguments[0],arguments[1],arguments[2],arguments[3]/255)}else{if(1==arguments.length)return new n.Color(...p(0,0,arguments[0]/100),1);if(2==arguments.length)return new n.Color(...p(0,0,arguments[0]/100),arguments[1]/255);if(3==arguments.length)return new n.Color(...p(arguments[0],arguments[1]/100,arguments[2]/100),1);if(4==arguments.length)return new n.Color(...p(arguments[0],arguments[1]/100,arguments[2]/100),arguments[3])}return null};n.red=function(e){return e._r};n.green=function(e){return e._g};n.blue=function(e){return e._b};n.alpha=function(e){return 255*e._a};n.hue=function(e){return e._inferHSV(),e._h};n.saturation=function(e){return e._inferHSV(),e._s};n.brightness=function(e){return e._inferHSV(),e._v};n.lightness=function(e){return 100*(.2126*e._r+.7152*e._g+.0722*e._b)/255};n.lerpColor=function(e,t,o){return n._colorMode==n.RGB?new n.Color(n.constrain(n.lerp(e._r,t._r,o),0,255),n.constrain(n.lerp(e._g,t._g,o),0,255),n.constrain(n.lerp(e._b,t._b,o),0,255),n.constrain(n.lerp(e._a,t._a,o),0,1)):(e._inferHSV(),t._inferHSV(),new n.Color(n.constrain(function(e,t,o){var a=[[Math.abs(t-e),n.map(o,0,1,e,t)],[Math.abs(t+360-e),n.map(o,0,1,e,t+360)],[Math.abs(t-360-e),n.map(o,0,1,e,t-360)]];return a.sort((e,t)=>e[0]-t[0]),(a[0][1]+720)%360}(e._h,t._h,o),0,360),n.constrain(n.lerp(e._s,t._s,o),0,100),n.constrain(n.lerp(e._v,t._v,o),0,100),n.constrain(n.lerp(e._a,t._a,o),0,1)))};function m(){o.fillStyle="white",o.strokeStyle="black",o.lineCap="round",o.lineJoin="miter"}n.strokeWeight=function(e){n._noStroke=!1,o.lineWidth=e};n.stroke=function(){if(n._noStroke=!1,"string"==typeof arguments[0])return void(o.strokeStyle=arguments[0]);let e=n.color.apply(null,arguments);e._a<=0?n._noStroke=!0:o.strokeStyle=e};n.noStroke=function(){n._noStroke=!0};n.fill=function(){if(n._noFill=!1,"string"==typeof arguments[0])return void(o.fillStyle=arguments[0]);let e=n.color.apply(null,arguments);e._a<=0?n._noFill=!0:o.fillStyle=e};n.noFill=function(){n._noFill=!0};n.blendMode=function(e){o.globalCompositeOperation=e};n.strokeCap=function(e){o.lineCap=e};n.strokeJoin=function(e){o.lineJoin=e};n.ellipseMode=function(e){n._ellipseMode=e};n.rectMode=function(e){n._rectMode=e};n.curveDetail=function(e){n._curveDetail=e};n.curveAlpha=function(e){n._curveAlpha=e};n.curveTightness=function(e){console.warn("curveTightness() sets the 'alpha' parameter of Catmull-Rom curve, and is NOT identical to p5.js counterpart. As this might change in the future, please call curveAlpha() directly."),n._curveAlpha=e};n.clear=function(){o.clearRect(0,0,n.width,n.height)};n.background=function(){if(arguments[0]&&arguments[0].MAGIC==n.MAGIC)return n.image(arguments[0],0,0,n.width,n.height);o.save(),o.resetTransform(),o.scale(n._pixelDensity,n._pixelDensity),"string"==typeof arguments[0]?o.fillStyle=arguments[0]:o.fillStyle=n.color(...Array.from(arguments)),o.fillRect(0,0,n.width,n.height),o.restore()};n.line=function(e,t,a,r){n._noStroke||(o.beginPath(),o.moveTo(e,t),o.lineTo(a,r),o.stroke())};function g(e){if(0<=e&&e<2*Math.PI)return e;for(;e<0;)e+=2*Math.PI;for(;e>=Math.PI;)e-=2*Math.PI;return e}function v(e,t,a,r,i,l,u,s){if(n._noFill&&n._noStroke)return;let c=g(i),h=g(l);o.beginPath();for(let i=0;i0?(m[e]=1,m[e+1]=0):(m[e]=0,m[e+1]=1));let g=e*m[0]+n*m[1],v=t*m[0]+o*m[1],M=n*m[2]+a*m[3],_=o*m[2]+r*m[3],x=a*m[4]+i*m[5],y=r*m[4]+l*m[5],w=g*m[6]+M*m[7],R=v*m[6]+_*m[7],I=M*m[8]+x*m[9],E=_*m[8]+y*m[9],S=w*m[2]+I*m[3],C=R*m[2]+E*m[3];h.push([S,C])}return h}(...a,...l,...u,...s,n._curveDetail,n._curveAlpha);for(let e=0;e=t?255:0}};y[n.GRAY]=function(e){for(let t=0;t>8)/n,e[o+1]=255*(e[o+1]*t>>8)/n,e[o+2]=255*(e[o+2]*t>>8)/n};y[n.DILATE]=function(e){R(),d.set(e);let[t,n]=[o.canvas.width,o.canvas.height];for(let o=0;o=1&&(s++,f--),(d*=2)>=1&&(c++,d--),(p*=2)>=1&&(h++,p--)}return m};n.noiseDetail=function(e,t){e>0&&(E=e),t>0&&(S=t)};const D=function(){let e,t,n=4294967295;return{setSeed(o){e=t=(null==o?Math.random()*n:o)>>>0},getSeed:()=>t,rand:()=>(e^=e<<17,e^=e>>13,((e^=e<<5)>>>0)/n)}};let T=D();T.setSeed();n.noiseSeed=function(e){let t=null==e?4294967295*Math.random():e;A||(A=new Float32Array(4096));for(var n=0;n<4096;n++)t^=t<<17,t^=t>>13,t^=t<<5,A[n]=(t>>>0)/4294967295};n.randomSeed=function(e){T.setSeed(e)};n.random=function(e,t){return null==e?T.rand():"number"==typeof e?null!=t?T.rand()*(t-e)+e:T.rand()*e:e[~~(e.length*T.rand())]};n.randomGenerator=function(e){e==n.LCG?T=function(){const e=4294967296;let t,n;return{setSeed(o){n=t=(null==o?Math.random()*e:o)>>>0},getSeed:()=>t,rand:()=>(n=(1664525*n+1013904223)%e)/e}}():e==n.SHR3&&(T=D()),T.setSeed()};var P=new function(){var e,t,n,o=new Array(128),a=new Array(256),r=new Array(128),i=new Array(128),l=new Array(256),u=new Array(256),s=function(){return 4294967296*T.rand()-2147483648},c=function(){return.5+2.328306e-10*(s()<<0)},h=function(){for(var t,a,l,u,h=3.44262;;){if(t=n*r[e],0==e){do{l=c(),u=c(),t=.2904764*-Math.log(l),a=-Math.log(u)}while(a+a0?h+t:-h-t}if(i[e]+c()*(i[e-1]-i[e])>>0)=1;t--)c=Math.sqrt(-2*Math.log(f/c+Math.exp(-.5*c*c))),o[t+1]=Math.floor(c/h*n),h=c,i[t]=Math.exp(-.5*c*c),r[t]=c/n;for(e=m/Math.exp(-d),a[0]=Math.floor(d/e*s),a[1]=0,l[0]=e/s,l[255]=d/s,u[0]=1,u[255]=Math.exp(-d),t=254;t>=1;t--)d=-Math.log(m/d+Math.exp(-d)),a[t+1]=Math.floor(d/p*s),p=d,u[t]=Math.exp(-d),l[t]=d/s}};P.hasInit=!1;n.randomGaussian=function(e,t){return P.hasInit||(P.zigset(),P.hasInit=!0),P.RNOR()*t+e};n.randomExponential=function(){return P.hasInit||(P.zigset(),P.hasInit=!0),P.REXP()};n.print=console.log;n.cursor=function(e,t,o){let a="";e.includes(".")&&(e=`url("${e}")`,a=", auto"),null!=t&&(e+=" "+t+" "+o),n.canvas.style.cursor=e+a};n.noCursor=function(){n.canvas.style.cursor="none"};n.createCapture=function(e){var t=document.createElement("video");return t.playsinline="playsinline",t.autoplay="autoplay",navigator.mediaDevices.getUserMedia(e).then(function(e){t.srcObject=e}),t.style.position="absolute",t.style.opacity=1e-5,t.style.zIndex=-1e3,document.body.appendChild(t),t};let b=["setup","draw","preload","mouseMoved","mousePressed","mouseReleased","mouseDragged","mouseClicked","keyPressed","keyReleased","keyTyped","touchStarted","touchEnded"];for(let e of b){let t="_"+e+"Fn";n[t]=function(){},n[t].isPlaceHolder=!0,n[e]?n[t]=n[e]:Object.defineProperty(n,e,{set:function(e){n[t]=e}})}function z(){n._noLoop||(a=null==n._frameRate?requestAnimationFrame(z):setTimeout(z,1e3/n._frameRate)),x(),r=!0,o.save(),n._drawFn(),o.restore(),n.frameCount++}n.noLoop=function(){n._noLoop=!0,a=null};n.loop=function(){n._noLoop=!1,null==a&&z()};n.redraw=function(){z()};n.frameRate=function(e){n._frameRate=e};setTimeout(function(){n._preloadFn(),c=window.performance.now(),function e(){if(u>0)return setTimeout(e,10);n._setupFn();z()}()},1);n.canvas.onmousemove=function(e){n.pmouseX=n.mouseX,n.pmouseY=n.mouseY,n.mouseX=e.offsetX,n.mouseY=e.offsetY,n.mouseIsPressed?n._mouseDraggedFn(e):n._mouseMovedFn(e)};n.canvas.onmousedown=function(e){n.pmouseX=n.mouseX,n.pmouseY=n.mouseY,n.mouseX=e.offsetX,n.mouseY=e.offsetY,n.mouseIsPressed=!0,n.mouseButton=[n.LEFT,n.CENTER,n.RIGHT][e.button],n._mousePressedFn(e)};n.canvas.onmouseup=function(e){n.pmouseX=n.mouseX,n.pmouseY=n.mouseY,n.mouseX=e.offsetX,n.mouseY=e.offsetY,n.mouseIsPressed=!1,n._mouseReleasedFn(e)};n.canvas.onclick=function(e){n.pmouseX=n.mouseX,n.pmouseY=n.mouseY,n.mouseX=e.offsetX,n.mouseY=e.offsetY,n.mouseIsPressed=!0,n._mouseClickedFn(e),n.mouseIsPressed=!1};window.addEventListener("keydown",function(e){n.keyIsPressed=!0,n.key=e.key,n.keyCode=e.keyCode,s[n.keyCode]=!0,n._keyPressedFn(e),1==e.key.length&&n._keyTypedFn(e)});window.addEventListener("keyup",function(e){n.keyIsPressed=!1,n.key=e.key,n.keyCode=e.keyCode,s[n.keyCode]=!1,n._keyReleasedFn(e)});n.keyIsDown=function(e){return!!s[e]};function O(e){const t=n.canvas.getBoundingClientRect(),o=n.canvas.scrollWidth/n.width||1,a=n.canvas.scrollHeight/n.height||1;return{x:(e.clientX-t.left)/o,y:(e.clientY-t.top)/a,id:e.identifier}}function k(){return n._touchStarted.isPlaceHolder&&n._touchMoved.isPlaceHolder&&n._touchEnded.isPlaceHolder}n.canvas.ontouchstart=function(e){n.touches=e.touches.map(O),k()&&(n.pmouseX=n.mouseX,n.pmouseY=n.mouseY,n.mouseX=n.touches[0].x,n.mouseY=n.touches[0].y,n.mouseIsPressed=!0,n.mouseButton=n.LEFT,n._mousePressedFn(e)||e.preventDefault()),n._touchStartedFn(e)||e.preventDefault()};n.canvas.ontouchmove=function(e){n.touches=e.touches.map(O),k()&&(n.pmouseX=n.mouseX,n.pmouseY=n.mouseY,n.mouseX=n.touches[0].x,n.mouseY=n.touches[0].y,n.mouseIsPressed=!0,n.mouseButton=n.LEFT,n._mouseDraggedFn(e)||e.preventDefault()),n._touchMovedFn(e)||e.preventDefault()};n.canvas.ontouchend=n.canvas.ontouchcancel=function(e){n.touches=e.touches.map(O),k()&&(n.pmouseX=n.mouseX,n.pmouseY=n.mouseY,n.mouseX=n.touches[0].x,n.mouseY=n.touches[0].y,n.mouseIsPressed=!1,n._mouseReleasedFn(e)||e.preventDefault()),n._touchEndedFn(e)||e.preventDefault()};n.hasSensorPermission=!window.DeviceOrientationEvent&&!window.DeviceMotionEvent||!(DeviceOrientationEvent.requestPermission||DeviceMotionEvent.requestPermission);n.requestSensorPermissions=function(){DeviceOrientationEvent.requestPermission&&DeviceOrientationEvent.requestPermission().then(e=>{"granted"==e&&DeviceMotionEvent.requestPermission&&DeviceMotionEvent.requestPermission().then(e=>{"granted"==e&&(n.hasSensorPermission=!0)}).catch(alert)}).catch(alert)};window.ondeviceorientation=function(e){n.pRotationX=n.rotationX,n.pRotationY=n.rotationY,n.pRotationZ=n.rotationZ,n.pRelRotationX=n.relRotationX,n.pRelRotationY=n.relRotationY,n.pRelRotationZ=n.relRotationZ,n.rotationX=e.beta*(Math.PI/180),n.rotationY=e.gamma*(Math.PI/180),n.rotationZ=e.alpha*(Math.PI/180),n.relRotationX=[-n.rotationY,-n.rotationX,n.rotationY][1+~~(window.orientation/90)],n.relRotationY=[-n.rotationX,n.rotationY,n.rotationX][1+~~(window.orientation/90)],n.relRotationZ=n.rotationZ};window.ondevicemotion=function(e){if(n.pAccelerationX=n.accelerationX,n.pAccelerationY=n.accelerationY,n.pAccelerationZ=n.accelerationZ,!e.acceleration){let t=((e,t)=>[(e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3])/(e[12]*t[0]+e[13]*t[1]+e[14]*t[2]+e[15]),(e[4]*t[0]+e[5]*t[1]+e[6]*t[2]+e[7])/(e[12]*t[0]+e[13]*t[1]+e[14]*t[2]+e[15]),(e[8]*t[0]+e[9]*t[1]+e[10]*t[2]+e[11])/(e[12]*t[0]+e[13]*t[1]+e[14]*t[2]+e[15])])(((e,t)=>[e[0]*t[0]+e[1]*t[4]+e[2]*t[8]+e[3]*t[12],e[0]*t[1]+e[1]*t[5]+e[2]*t[9]+e[3]*t[13],e[0]*t[2]+e[1]*t[6]+e[2]*t[10]+e[3]*t[14],e[0]*t[3]+e[1]*t[7]+e[2]*t[11]+e[3]*t[15],e[4]*t[0]+e[5]*t[4]+e[6]*t[8]+e[7]*t[12],e[4]*t[1]+e[5]*t[5]+e[6]*t[9]+e[7]*t[13],e[4]*t[2]+e[5]*t[6]+e[6]*t[10]+e[7]*t[14],e[4]*t[3]+e[5]*t[7]+e[6]*t[11]+e[7]*t[15],e[8]*t[0]+e[9]*t[4]+e[10]*t[8]+e[11]*t[12],e[8]*t[1]+e[9]*t[5]+e[10]*t[9]+e[11]*t[13],e[8]*t[2]+e[9]*t[6]+e[10]*t[10]+e[11]*t[14],e[8]*t[3]+e[9]*t[7]+e[10]*t[11]+e[11]*t[15],e[12]*t[0]+e[13]*t[4]+e[14]*t[8]+e[15]*t[12],e[12]*t[1]+e[13]*t[5]+e[14]*t[9]+e[15]*t[13],e[12]*t[2]+e[13]*t[6]+e[14]*t[10]+e[15]*t[14],e[12]*t[3]+e[13]*t[7]+e[14]*t[11]+e[15]*t[15]])((e=>[Math.cos(e),0,Math.sin(e),0,0,1,0,0,-Math.sin(e),0,Math.cos(e),0,0,0,0,1])(n.rotationY),(e=>[1,0,0,0,0,Math.cos(e),-Math.sin(e),0,0,Math.sin(e),Math.cos(e),0,0,0,0,1])(n.rotationX)),[0,0,-9.80665]);n.accelerationX=e.accelerationIncludingGravity.x+t[0],n.accelerationY=e.accelerationIncludingGravity.y+t[1],n.accelerationZ=e.accelerationIncludingGravity.z-t[2]}};n.year=function(){return(new Date).getFullYear()};n.day=function(){return(new Date).getDay()};n.hour=function(){return(new Date).getHours()};n.minute=function(){return(new Date).getMinutes()};n.second=function(){return(new Date).getSeconds()};n.millis=function(){return window.performance.now()-c}}(e)} \ No newline at end of file diff --git a/tests.js b/tests.js index 6bba049..728ffc2 100644 --- a/tests.js +++ b/tests.js @@ -2609,6 +2609,7 @@ text(lines, 70, 25); /*~~~ https://p5js.org/reference/#/p5/textSize ~~~*/ fill(0); +noStroke(); textSize(12); text('Font Size 12', 10, 30); textSize(14);