Comparing version 0.0.6 to 0.0.7
/*! | ||
* DOMMatrix v0.0.6 (https://github.com/thednp/dommatrix) | ||
* DOMMatrix v0.0.7 (https://github.com/thednp/dommatrix) | ||
* Copyright 2021 © thednp | ||
@@ -746,2 +746,2 @@ * Licensed under MIT (https://github.com/thednp/DOMMatrix/blob/master/LICENSE) | ||
export default CSSMatrix; | ||
export { CSSMatrix as default }; |
@@ -1,2 +0,2 @@ | ||
// DOMMatrix v0.0.6 | thednp © 2021 | MIT-License | ||
class m{constructor(...m){return this.setIdentity(),m&&m.length&&this.setMatrixValue(m)}get isIdentity(){const m=this;return 1===m.m11&&0===m.m12&&0===m.m13&&0===m.m14&&0===m.m21&&1===m.m22&&0===m.m23&&0===m.m24&&0===m.m31&&0===m.m32&&1===m.m33&&0===m.m34&&0===m.m41&&0===m.m42&&0===m.m43&&1===m.m44}set isIdentity(m){this.isIdentity=m}get is2D(){const m=this;return 0===m.m31&&0===m.m32&&1===m.m33&&0===m.m34&&0===m.m43&&1===m.m44}set is2D(m){this.is2D=m}}const t=m.prototype;function n(t,n,r){const e=new m;return e.m41=t,e.e=t,e.m42=n,e.f=n,e.m43=r,e}function r(t,n,r){const e=new m,i=t*Math.PI/180,s=n*Math.PI/180,o=r*Math.PI/180,a=Math.cos(i),c=-Math.sin(i),u=Math.cos(s),l=-Math.sin(s),h=Math.cos(o),f=-Math.sin(o),y=u*h,x=-u*f;e.m11=y,e.a=y,e.m12=x,e.b=x,e.m13=l;const w=c*l*h+a*f;e.m21=w,e.c=w;const M=a*h-c*l*f;return e.m22=M,e.d=M,e.m23=-c*u,e.m31=c*f-a*l*h,e.m32=c*h+a*l*f,e.m33=a*u,e}function e(t,n,r,e){const i=new m,s=e*Math.PI/360,o=Math.sin(s),a=Math.cos(s),c=o*o,u=Math.sqrt(t*t+n*n+r*r);let l=0,h=0,f=1;0!==u&&(l=t/u,h=n/u,f=r/u);const y=l*l,x=h*h,w=f*f,M=1-2*(x+w)*c;i.m11=M,i.a=M;const d=2*(t*n*c+r*o*a);i.m12=d,i.b=d,i.m13=2*(t*r*c-n*o*a);const g=2*(n*t*c-r*o*a);i.m21=g,i.c=g;const p=1-2*(w+y)*c;return i.m22=p,i.d=p,i.m23=2*(n*r*c+t*o*a),i.m31=2*(r*t*c+n*o*a),i.m32=2*(r*n*c-t*o*a),i.m33=1-2*(y+x)*c,i.m14=0,i.m24=0,i.m34=0,i.m41=0,i.e=0,i.m42=0,i.f=0,i.m43=0,i.m44=1,i}function i(t,n,r){const e=new m;return e.m11=t,e.a=t,e.m22=n,e.d=n,e.m33=r,e}function s(t){const n=t*Math.PI/180,r=new m,e=Math.tan(n);return r.m21=e,r.c=e,r}function o(t){const n=t*Math.PI/180,r=new m,e=Math.tan(n);return r.m12=e,r.b=e,r}function a(t,n){const r=n.m11*t.m11+n.m12*t.m21+n.m13*t.m31+n.m14*t.m41,e=n.m11*t.m12+n.m12*t.m22+n.m13*t.m32+n.m14*t.m42,i=n.m11*t.m13+n.m12*t.m23+n.m13*t.m33+n.m14*t.m43,s=n.m11*t.m14+n.m12*t.m24+n.m13*t.m34+n.m14*t.m44,o=n.m21*t.m11+n.m22*t.m21+n.m23*t.m31+n.m24*t.m41,a=n.m21*t.m12+n.m22*t.m22+n.m23*t.m32+n.m24*t.m42,c=n.m21*t.m13+n.m22*t.m23+n.m23*t.m33+n.m24*t.m43,u=n.m21*t.m14+n.m22*t.m24+n.m23*t.m34+n.m24*t.m44,l=n.m31*t.m11+n.m32*t.m21+n.m33*t.m31+n.m34*t.m41,h=n.m31*t.m12+n.m32*t.m22+n.m33*t.m32+n.m34*t.m42,f=n.m31*t.m13+n.m32*t.m23+n.m33*t.m33+n.m34*t.m43,y=n.m31*t.m14+n.m32*t.m24+n.m33*t.m34+n.m34*t.m44,x=n.m41*t.m11+n.m42*t.m21+n.m43*t.m31+n.m44*t.m41,w=n.m41*t.m12+n.m42*t.m22+n.m43*t.m32+n.m44*t.m42,M=n.m41*t.m13+n.m42*t.m23+n.m43*t.m33+n.m44*t.m43,d=n.m41*t.m14+n.m42*t.m24+n.m43*t.m34+n.m44*t.m44;return new m([r,o,l,x,e,a,h,w,i,c,f,M,s,u,y,d])}function c(m,t){const n=Array.from(t);if(16===n.length){const[t,r,e,i,s,o,a,c,u,l,h,f,y,x,w,M]=n;m.m11=t,m.a=t,m.m21=r,m.c=r,m.m31=e,m.m41=i,m.e=i,m.m12=s,m.b=s,m.m22=o,m.d=o,m.m32=a,m.m42=c,m.f=c,m.m13=u,m.m23=l,m.m33=h,m.m43=f,m.m14=y,m.m24=x,m.m34=w,m.m44=M}else{if(6!==n.length)throw new TypeError("CSSMatrix: expecting a 6/16 values Array");{const[t,r,e,i,s,o]=n;m.m11=t,m.a=t,m.m12=r,m.b=r,m.m21=e,m.c=e,m.m22=i,m.d=i,m.m14=s,m.e=s,m.m24=o,m.f=o}}return m}t.setMatrixValue=function(t){const n=this;if(!t||!t.length)return n;if(t.length&&"string"==typeof t[0]&&t[0].length){const m=String(t[0]).trim();let r="",e=[];if("none"===m)return n;if(r=m.slice(0,m.indexOf("(")),e=m.slice("matrix"===r?7:9,-1).split(",").map(m=>Math.abs(m)<1e-6?0:+m),!([6,16].indexOf(e.length)>-1))throw new TypeError("CSSMatrix: expecting valid CSS matrix() / matrix3d() syntax");c(n,e)}else t[0]instanceof m?c(n,t[0].toArray()):Array.isArray(t[0])?c(n,t[0]):Array.isArray(t)&&c(n,t);return n},t.toString=function(){return`${this.is2D?"matrix":"matrix3d"}(${this.toArray(1).join(",")})`},t.toArray=function(m){const t=this;let n;return n=t.is2D?[t.a,t.b,t.c,t.d,t.e,t.f]:m?[t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.m41,t.m42,t.m43,t.m44]:[t.m11,t.m21,t.m31,t.m41,t.m12,t.m22,t.m32,t.m42,t.m13,t.m23,t.m33,t.m43,t.m14,t.m24,t.m34,t.m44],n},t.multiply=function(m){return a(this,m)},t.translate=function(m,t,r){let e=t,i=r;return null==i&&(i=0),null==e&&(e=0),a(this,n(m,e,i))},t.scale=function(m,t,n){let r=t,e=n;return null==r&&(r=m),null==e&&(e=m),a(this,i(m,r,e))},t.rotate=function(m,t,n){let e=m,i=t,s=n;return null==i&&(i=0),null==s&&(s=e,e=0),a(this,r(e,i,s))},t.rotateAxisAngle=function(m,t,n,r){if(4!==arguments.length)throw new TypeError("CSSMatrix: expecting 4 values");return a(this,e(m,t,n,r))},t.skewX=function(m){return a(this,s(m))},t.skewY=function(m){return a(this,o(m))},t.setIdentity=function(){return c(this,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},t.transformPoint=function(m){let t=n(m.x,m.y,m.z);return t.m44=m.w||1,t=this.multiply(t),{x:t.m41,y:t.m42,z:t.m43,w:t.m44}},t.transform=function(m){const t=this,n=t.m11*m.x+t.m12*m.y+t.m13*m.z+t.m14*m.w,r=t.m21*m.x+t.m22*m.y+t.m23*m.z+t.m24*m.w,e=t.m31*m.x+t.m32*m.y+t.m33*m.z+t.m34*m.w,i=t.m41*m.x+t.m42*m.y+t.m43*m.z+t.m44*m.w;return{x:n/i,y:r/i,z:e/i,w:i}},m.Translate=n,m.Rotate=r,m.RotateAxisAngle=e,m.Scale=i,m.SkewX=s,m.SkewY=o,m.Multiply=a,m.fromMatrix=function(t){return new m([t.m11,t.m21,t.m31,t.m41,t.m12,t.m22,t.m32,t.m42,t.m13,t.m23,t.m33,t.m43,t.m14,t.m24,t.m34,t.m44])},m.fromArray=function(t){return c(new m,t)},m.feedFromArray=c;export default m; | ||
// DOMMatrix v0.0.7 | thednp © 2021 | MIT-License | ||
class m{constructor(...m){return this.setIdentity(),m&&m.length&&this.setMatrixValue(m)}get isIdentity(){const m=this;return 1===m.m11&&0===m.m12&&0===m.m13&&0===m.m14&&0===m.m21&&1===m.m22&&0===m.m23&&0===m.m24&&0===m.m31&&0===m.m32&&1===m.m33&&0===m.m34&&0===m.m41&&0===m.m42&&0===m.m43&&1===m.m44}set isIdentity(m){this.isIdentity=m}get is2D(){const m=this;return 0===m.m31&&0===m.m32&&1===m.m33&&0===m.m34&&0===m.m43&&1===m.m44}set is2D(m){this.is2D=m}}const t=m.prototype;function n(t,n,r){const e=new m;return e.m41=t,e.e=t,e.m42=n,e.f=n,e.m43=r,e}function r(t,n,r){const e=new m,i=t*Math.PI/180,s=n*Math.PI/180,o=r*Math.PI/180,a=Math.cos(i),c=-Math.sin(i),u=Math.cos(s),l=-Math.sin(s),h=Math.cos(o),f=-Math.sin(o),y=u*h,x=-u*f;e.m11=y,e.a=y,e.m12=x,e.b=x,e.m13=l;const w=c*l*h+a*f;e.m21=w,e.c=w;const M=a*h-c*l*f;return e.m22=M,e.d=M,e.m23=-c*u,e.m31=c*f-a*l*h,e.m32=c*h+a*l*f,e.m33=a*u,e}function e(t,n,r,e){const i=new m,s=e*Math.PI/360,o=Math.sin(s),a=Math.cos(s),c=o*o,u=Math.sqrt(t*t+n*n+r*r);let l=0,h=0,f=1;0!==u&&(l=t/u,h=n/u,f=r/u);const y=l*l,x=h*h,w=f*f,M=1-2*(x+w)*c;i.m11=M,i.a=M;const d=2*(t*n*c+r*o*a);i.m12=d,i.b=d,i.m13=2*(t*r*c-n*o*a);const g=2*(n*t*c-r*o*a);i.m21=g,i.c=g;const p=1-2*(w+y)*c;return i.m22=p,i.d=p,i.m23=2*(n*r*c+t*o*a),i.m31=2*(r*t*c+n*o*a),i.m32=2*(r*n*c-t*o*a),i.m33=1-2*(y+x)*c,i.m14=0,i.m24=0,i.m34=0,i.m41=0,i.e=0,i.m42=0,i.f=0,i.m43=0,i.m44=1,i}function i(t,n,r){const e=new m;return e.m11=t,e.a=t,e.m22=n,e.d=n,e.m33=r,e}function s(t){const n=t*Math.PI/180,r=new m,e=Math.tan(n);return r.m21=e,r.c=e,r}function o(t){const n=t*Math.PI/180,r=new m,e=Math.tan(n);return r.m12=e,r.b=e,r}function a(t,n){const r=n.m11*t.m11+n.m12*t.m21+n.m13*t.m31+n.m14*t.m41,e=n.m11*t.m12+n.m12*t.m22+n.m13*t.m32+n.m14*t.m42,i=n.m11*t.m13+n.m12*t.m23+n.m13*t.m33+n.m14*t.m43,s=n.m11*t.m14+n.m12*t.m24+n.m13*t.m34+n.m14*t.m44,o=n.m21*t.m11+n.m22*t.m21+n.m23*t.m31+n.m24*t.m41,a=n.m21*t.m12+n.m22*t.m22+n.m23*t.m32+n.m24*t.m42,c=n.m21*t.m13+n.m22*t.m23+n.m23*t.m33+n.m24*t.m43,u=n.m21*t.m14+n.m22*t.m24+n.m23*t.m34+n.m24*t.m44,l=n.m31*t.m11+n.m32*t.m21+n.m33*t.m31+n.m34*t.m41,h=n.m31*t.m12+n.m32*t.m22+n.m33*t.m32+n.m34*t.m42,f=n.m31*t.m13+n.m32*t.m23+n.m33*t.m33+n.m34*t.m43,y=n.m31*t.m14+n.m32*t.m24+n.m33*t.m34+n.m34*t.m44,x=n.m41*t.m11+n.m42*t.m21+n.m43*t.m31+n.m44*t.m41,w=n.m41*t.m12+n.m42*t.m22+n.m43*t.m32+n.m44*t.m42,M=n.m41*t.m13+n.m42*t.m23+n.m43*t.m33+n.m44*t.m43,d=n.m41*t.m14+n.m42*t.m24+n.m43*t.m34+n.m44*t.m44;return new m([r,o,l,x,e,a,h,w,i,c,f,M,s,u,y,d])}function c(m,t){const n=Array.from(t);if(16===n.length){const[t,r,e,i,s,o,a,c,u,l,h,f,y,x,w,M]=n;m.m11=t,m.a=t,m.m21=r,m.c=r,m.m31=e,m.m41=i,m.e=i,m.m12=s,m.b=s,m.m22=o,m.d=o,m.m32=a,m.m42=c,m.f=c,m.m13=u,m.m23=l,m.m33=h,m.m43=f,m.m14=y,m.m24=x,m.m34=w,m.m44=M}else{if(6!==n.length)throw new TypeError("CSSMatrix: expecting a 6/16 values Array");{const[t,r,e,i,s,o]=n;m.m11=t,m.a=t,m.m12=r,m.b=r,m.m21=e,m.c=e,m.m22=i,m.d=i,m.m14=s,m.e=s,m.m24=o,m.f=o}}return m}t.setMatrixValue=function(t){const n=this;if(!t||!t.length)return n;if(t.length&&"string"==typeof t[0]&&t[0].length){const m=String(t[0]).trim();let r="",e=[];if("none"===m)return n;if(r=m.slice(0,m.indexOf("(")),e=m.slice("matrix"===r?7:9,-1).split(",").map(m=>Math.abs(m)<1e-6?0:+m),!([6,16].indexOf(e.length)>-1))throw new TypeError("CSSMatrix: expecting valid CSS matrix() / matrix3d() syntax");c(n,e)}else t[0]instanceof m?c(n,t[0].toArray()):Array.isArray(t[0])?c(n,t[0]):Array.isArray(t)&&c(n,t);return n},t.toString=function(){return`${this.is2D?"matrix":"matrix3d"}(${this.toArray(1).join(",")})`},t.toArray=function(m){const t=this;let n;return n=t.is2D?[t.a,t.b,t.c,t.d,t.e,t.f]:m?[t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.m41,t.m42,t.m43,t.m44]:[t.m11,t.m21,t.m31,t.m41,t.m12,t.m22,t.m32,t.m42,t.m13,t.m23,t.m33,t.m43,t.m14,t.m24,t.m34,t.m44],n},t.multiply=function(m){return a(this,m)},t.translate=function(m,t,r){let e=t,i=r;return null==i&&(i=0),null==e&&(e=0),a(this,n(m,e,i))},t.scale=function(m,t,n){let r=t,e=n;return null==r&&(r=m),null==e&&(e=m),a(this,i(m,r,e))},t.rotate=function(m,t,n){let e=m,i=t,s=n;return null==i&&(i=0),null==s&&(s=e,e=0),a(this,r(e,i,s))},t.rotateAxisAngle=function(m,t,n,r){if(4!==arguments.length)throw new TypeError("CSSMatrix: expecting 4 values");return a(this,e(m,t,n,r))},t.skewX=function(m){return a(this,s(m))},t.skewY=function(m){return a(this,o(m))},t.setIdentity=function(){return c(this,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},t.transformPoint=function(m){let t=n(m.x,m.y,m.z);return t.m44=m.w||1,t=this.multiply(t),{x:t.m41,y:t.m42,z:t.m43,w:t.m44}},t.transform=function(m){const t=this,n=t.m11*m.x+t.m12*m.y+t.m13*m.z+t.m14*m.w,r=t.m21*m.x+t.m22*m.y+t.m23*m.z+t.m24*m.w,e=t.m31*m.x+t.m32*m.y+t.m33*m.z+t.m34*m.w,i=t.m41*m.x+t.m42*m.y+t.m43*m.z+t.m44*m.w;return{x:n/i,y:r/i,z:e/i,w:i}},m.Translate=n,m.Rotate=r,m.RotateAxisAngle=e,m.Scale=i,m.SkewX=s,m.SkewY=o,m.Multiply=a,m.fromMatrix=function(t){return new m([t.m11,t.m21,t.m31,t.m41,t.m12,t.m22,t.m32,t.m42,t.m13,t.m23,t.m33,t.m43,t.m14,t.m24,t.m34,t.m44])},m.fromArray=function(t){return c(new m,t)},m.feedFromArray=c;export{m as default}; |
/*! | ||
* DOMMatrix v0.0.6 (https://github.com/thednp/dommatrix) | ||
* DOMMatrix v0.0.7 (https://github.com/thednp/dommatrix) | ||
* Copyright 2021 © thednp | ||
@@ -10,3 +10,3 @@ * Licensed under MIT (https://github.com/thednp/DOMMatrix/blob/master/LICENSE) | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.CSSMatrix = factory()); | ||
}(this, (function () { 'use strict'; | ||
})(this, (function () { 'use strict'; | ||
@@ -777,2 +777,2 @@ /** | ||
}))); | ||
})); |
@@ -1,2 +0,2 @@ | ||
// DOMMatrix v0.0.6 | thednp © 2021 | MIT-License | ||
// DOMMatrix v0.0.7 | thednp © 2021 | MIT-License | ||
!function(m,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(m="undefined"!=typeof globalThis?globalThis:m||self).CSSMatrix=t()}(this,(function(){"use strict";var m=function(){for(var m=[],t=arguments.length;t--;)m[t]=arguments[t];return this.setIdentity(),m&&m.length&&this.setMatrixValue(m)},t={isIdentity:{configurable:!0},is2D:{configurable:!0}};t.isIdentity.get=function(){var m=this;return 1===m.m11&&0===m.m12&&0===m.m13&&0===m.m14&&0===m.m21&&1===m.m22&&0===m.m23&&0===m.m24&&0===m.m31&&0===m.m32&&1===m.m33&&0===m.m34&&0===m.m41&&0===m.m42&&0===m.m43&&1===m.m44},t.isIdentity.set=function(m){this.isIdentity=m},t.is2D.get=function(){var m=this;return 0===m.m31&&0===m.m32&&1===m.m33&&0===m.m34&&0===m.m43&&1===m.m44},t.is2D.set=function(m){this.is2D=m},Object.defineProperties(m.prototype,t);var n=m.prototype;function r(t,n,r){var e=new m;return e.m41=t,e.e=t,e.m42=n,e.f=n,e.m43=r,e}function e(t,n,r){var e=new m,i=t*Math.PI/180,a=n*Math.PI/180,u=r*Math.PI/180,o=Math.cos(i),s=-Math.sin(i),f=Math.cos(a),c=-Math.sin(a),h=Math.cos(u),l=-Math.sin(u),y=f*h,v=-f*l;e.m11=y,e.a=y,e.m12=v,e.b=v,e.m13=c;var d=s*c*h+o*l;e.m21=d,e.c=d;var x=o*h-s*c*l;return e.m22=x,e.d=x,e.m23=-s*f,e.m31=s*l-o*c*h,e.m32=s*h+o*c*l,e.m33=o*f,e}function i(t,n,r,e){var i=new m,a=e*Math.PI/360,u=Math.sin(a),o=Math.cos(a),s=u*u,f=Math.sqrt(t*t+n*n+r*r),c=0,h=0,l=1;0!==f&&(c=t/f,h=n/f,l=r/f);var y=c*c,v=h*h,d=l*l,x=1-2*(v+d)*s;i.m11=x,i.a=x;var w=2*(t*n*s+r*u*o);i.m12=w,i.b=w,i.m13=2*(t*r*s-n*u*o);var M=2*(n*t*s-r*u*o);i.m21=M,i.c=M;var g=1-2*(d+y)*s;return i.m22=g,i.d=g,i.m23=2*(n*r*s+t*u*o),i.m31=2*(r*t*s+n*u*o),i.m32=2*(r*n*s-t*u*o),i.m33=1-2*(y+v)*s,i.m14=0,i.m24=0,i.m34=0,i.m41=0,i.e=0,i.m42=0,i.f=0,i.m43=0,i.m44=1,i}function a(t,n,r){var e=new m;return e.m11=t,e.a=t,e.m22=n,e.d=n,e.m33=r,e}function u(t){var n=t*Math.PI/180,r=new m,e=Math.tan(n);return r.m21=e,r.c=e,r}function o(t){var n=t*Math.PI/180,r=new m,e=Math.tan(n);return r.m12=e,r.b=e,r}function s(t,n){var r=n.m11*t.m11+n.m12*t.m21+n.m13*t.m31+n.m14*t.m41,e=n.m11*t.m12+n.m12*t.m22+n.m13*t.m32+n.m14*t.m42,i=n.m11*t.m13+n.m12*t.m23+n.m13*t.m33+n.m14*t.m43,a=n.m11*t.m14+n.m12*t.m24+n.m13*t.m34+n.m14*t.m44,u=n.m21*t.m11+n.m22*t.m21+n.m23*t.m31+n.m24*t.m41,o=n.m21*t.m12+n.m22*t.m22+n.m23*t.m32+n.m24*t.m42,s=n.m21*t.m13+n.m22*t.m23+n.m23*t.m33+n.m24*t.m43,f=n.m21*t.m14+n.m22*t.m24+n.m23*t.m34+n.m24*t.m44,c=n.m31*t.m11+n.m32*t.m21+n.m33*t.m31+n.m34*t.m41,h=n.m31*t.m12+n.m32*t.m22+n.m33*t.m32+n.m34*t.m42,l=n.m31*t.m13+n.m32*t.m23+n.m33*t.m33+n.m34*t.m43,y=n.m31*t.m14+n.m32*t.m24+n.m33*t.m34+n.m34*t.m44,v=n.m41*t.m11+n.m42*t.m21+n.m43*t.m31+n.m44*t.m41,d=n.m41*t.m12+n.m42*t.m22+n.m43*t.m32+n.m44*t.m42,x=n.m41*t.m13+n.m42*t.m23+n.m43*t.m33+n.m44*t.m43,w=n.m41*t.m14+n.m42*t.m24+n.m43*t.m34+n.m44*t.m44;return new m([r,u,c,v,e,o,h,d,i,s,l,x,a,f,y,w])}function f(m,t){var n=Array.from(t);if(16===n.length){var r=n[0],e=n[1],i=n[2],a=n[3],u=n[4],o=n[5],s=n[6],f=n[7],c=n[8],h=n[9],l=n[10],y=n[11],v=n[12],d=n[13],x=n[14],w=n[15];m.m11=r,m.a=r,m.m21=e,m.c=e,m.m31=i,m.m41=a,m.e=a,m.m12=u,m.b=u,m.m22=o,m.d=o,m.m32=s,m.m42=f,m.f=f,m.m13=c,m.m23=h,m.m33=l,m.m43=y,m.m14=v,m.m24=d,m.m34=x,m.m44=w}else{if(6!==n.length)throw new TypeError("CSSMatrix: expecting a 6/16 values Array");var M=n[0],g=n[1],p=n[2],A=n[3],S=n[4],b=n[5];m.m11=M,m.a=M,m.m12=g,m.b=g,m.m21=p,m.c=p,m.m22=A,m.d=A,m.m14=S,m.e=S,m.m24=b,m.f=b}return m}return n.setMatrixValue=function(t){var n=this;if(!t||!t.length)return n;if(t.length&&"string"==typeof t[0]&&t[0].length){var r,e,i=String(t[0]).trim();if("none"===i)return n;if(r=i.slice(0,i.indexOf("(")),e=i.slice("matrix"===r?7:9,-1).split(",").map((function(m){return Math.abs(m)<1e-6?0:+m})),!([6,16].indexOf(e.length)>-1))throw new TypeError("CSSMatrix: expecting valid CSS matrix() / matrix3d() syntax");f(n,e)}else t[0]instanceof m?f(n,t[0].toArray()):Array.isArray(t[0])?f(n,t[0]):Array.isArray(t)&&f(n,t);return n},n.toString=function(){return(this.is2D?"matrix":"matrix3d")+"("+this.toArray(1).join(",")+")"},n.toArray=function(m){var t=this;return t.is2D?[t.a,t.b,t.c,t.d,t.e,t.f]:m?[t.m11,t.m12,t.m13,t.m14,t.m21,t.m22,t.m23,t.m24,t.m31,t.m32,t.m33,t.m34,t.m41,t.m42,t.m43,t.m44]:[t.m11,t.m21,t.m31,t.m41,t.m12,t.m22,t.m32,t.m42,t.m13,t.m23,t.m33,t.m43,t.m14,t.m24,t.m34,t.m44]},n.multiply=function(m){return s(this,m)},n.translate=function(m,t,n){var e=t,i=n;return null==i&&(i=0),null==e&&(e=0),s(this,r(m,e,i))},n.scale=function(m,t,n){var r=t,e=n;return null==r&&(r=m),null==e&&(e=m),s(this,a(m,r,e))},n.rotate=function(m,t,n){var r=m,i=t,a=n;return null==i&&(i=0),null==a&&(a=r,r=0),s(this,e(r,i,a))},n.rotateAxisAngle=function(m,t,n,r){if(4!==arguments.length)throw new TypeError("CSSMatrix: expecting 4 values");return s(this,i(m,t,n,r))},n.skewX=function(m){return s(this,u(m))},n.skewY=function(m){return s(this,o(m))},n.setIdentity=function(){return f(this,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},n.transformPoint=function(m){var t=r(m.x,m.y,m.z);return t.m44=m.w||1,{x:(t=this.multiply(t)).m41,y:t.m42,z:t.m43,w:t.m44}},n.transform=function(m){var t=this,n=t.m11*m.x+t.m12*m.y+t.m13*m.z+t.m14*m.w,r=t.m21*m.x+t.m22*m.y+t.m23*m.z+t.m24*m.w,e=t.m31*m.x+t.m32*m.y+t.m33*m.z+t.m34*m.w,i=t.m41*m.x+t.m42*m.y+t.m43*m.z+t.m44*m.w;return{x:n/i,y:r/i,z:e/i,w:i}},m.Translate=r,m.Rotate=e,m.RotateAxisAngle=i,m.Scale=a,m.SkewX=u,m.SkewY=o,m.Multiply=s,m.fromMatrix=function(t){return new m([t.m11,t.m21,t.m31,t.m41,t.m12,t.m22,t.m32,t.m42,t.m13,t.m23,t.m33,t.m43,t.m14,t.m24,t.m34,t.m44])},m.fromArray=function(t){return f(new m,t)},m.feedFromArray=f,m})); |
{ | ||
"name": "dommatrix", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "ES6+ shim for DOMMatrix", | ||
"main": "dist/dommatrix.min.js", | ||
"module": "dist/dommatrix.esm.js", | ||
"types": "types/index.d.ts", | ||
"jsnext": "src/index.js", | ||
"files": [ | ||
"dist/*.{js,map}", | ||
"types/*.{ts,map}", | ||
"src/*.{js,map}" | ||
@@ -18,2 +20,3 @@ ], | ||
"lint:js": "eslint src/*.js --config .eslintrc", | ||
"build-ts": "tsc -d", | ||
"build-js": "rollup --environment FORMAT:umd,MIN:false -c", | ||
@@ -52,4 +55,5 @@ "build-js-min": "rollup --environment FORMAT:umd,MIN:true -c", | ||
"npm-run-all": "^4.1.5", | ||
"rollup": "^2.28.1" | ||
"rollup": "^2.28.1", | ||
"typescript": "^4.4.4" | ||
} | ||
} |
@@ -0,0 +0,0 @@ # DOMMatrix shim |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93737
9
2184
8