vislite 0.5.2-alpha.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +18 -18
- package/AUTHORS.txt +6 -6
- package/CHANGELOG +143 -137
- package/LICENSE +20 -20
- package/README.md +69 -69
- package/lib/Buffer/index.umd.js +36 -36
- package/lib/Buffer/index.umd.min.js +2 -2
- package/lib/Canvas/index.umd.js +650 -650
- package/lib/Canvas/index.umd.min.js +2 -2
- package/lib/Cardinal/index.umd.js +91 -91
- package/lib/Cardinal/index.umd.min.js +2 -2
- package/lib/Eoap/index.umd.js +34 -34
- package/lib/Eoap/index.umd.min.js +2 -2
- package/lib/Geometry/index.umd.js +142 -142
- package/lib/Geometry/index.umd.min.js +2 -2
- package/lib/Hermite/index.umd.js +36 -36
- package/lib/Hermite/index.umd.min.js +2 -2
- package/lib/Matrix4/index.umd.js +119 -119
- package/lib/Matrix4/index.umd.min.js +2 -2
- package/lib/Mercator/index.umd.js +20 -20
- package/lib/Mercator/index.umd.min.js +2 -2
- package/lib/OralCanvas/index.es.js +598 -598
- package/lib/OralCanvas/index.es.min.js +2 -2
- package/lib/OralWebGL/index.es.js +532 -532
- package/lib/OralWebGL/index.es.min.js +3 -3
- package/lib/SVG/index.umd.js +470 -405
- package/lib/SVG/index.umd.min.js +3 -3
- package/lib/Shader/index.umd.js +69 -69
- package/lib/Shader/index.umd.min.js +3 -3
- package/lib/Texture/index.umd.js +53 -53
- package/lib/Texture/index.umd.min.js +2 -2
- package/lib/TreeLayout/index.umd.js +363 -363
- package/lib/TreeLayout/index.umd.min.js +2 -2
- package/lib/WebGL/index.umd.js +579 -579
- package/lib/WebGL/index.umd.min.js +3 -3
- package/lib/animation/index.umd.js +72 -72
- package/lib/animation/index.umd.min.js +2 -2
- package/lib/formatColor/index.umd.js +40 -40
- package/lib/formatColor/index.umd.min.js +2 -2
- package/lib/getLoopColors/index.umd.js +36 -36
- package/lib/getLoopColors/index.umd.min.js +2 -2
- package/lib/getWebGLContext/index.umd.js +44 -44
- package/lib/getWebGLContext/index.umd.min.js +2 -2
- package/lib/index.umd.js +2744 -2662
- package/lib/index.umd.min.js +3 -3
- package/lib/move/index.umd.js +27 -0
- package/lib/move/index.umd.min.js +11 -0
- package/lib/resizeObserver/index.umd.js +29 -29
- package/lib/resizeObserver/index.umd.min.js +2 -2
- package/lib/rotate/index.umd.js +8 -8
- package/lib/rotate/index.umd.min.js +2 -2
- package/lib/ruler/index.umd.js +126 -126
- package/lib/ruler/index.umd.min.js +2 -2
- package/lib/scale/index.umd.js +26 -0
- package/lib/scale/index.umd.min.js +11 -0
- package/lib/throttle/index.umd.js +49 -49
- package/lib/throttle/index.umd.min.js +2 -2
- package/lib/viewHandler/index.umd.js +120 -120
- package/lib/viewHandler/index.umd.min.js +2 -2
- package/miniprogram/ui-canvas/index.js +107 -107
- package/miniprogram/ui-canvas/index.json +4 -4
- package/miniprogram/ui-canvas/index.wxml +4 -4
- package/miniprogram/ui-canvas/index.wxss +5 -5
- package/package/Buffer/index.ts +2 -2
- package/package/Canvas/index.ts +2 -2
- package/package/Cardinal/index.ts +2 -2
- package/package/Eoap/index.ts +2 -2
- package/package/Geometry/index.ts +2 -2
- package/package/Hermite/index.ts +2 -2
- package/package/Matrix4/index.ts +2 -2
- package/package/Mercator/index.ts +2 -2
- package/package/OralCanvas/index.ts +2 -2
- package/package/OralWebGL/index.ts +2 -2
- package/package/SVG/index.ts +2 -2
- package/package/Shader/index.ts +39 -39
- package/package/Texture/index.ts +2 -2
- package/package/TreeLayout/index.ts +2 -2
- package/package/WebGL/index.ts +2 -2
- package/package/animation/index.ts +2 -2
- package/package/formatColor/index.ts +2 -2
- package/package/getLoopColors/index.ts +2 -2
- package/package/getWebGLContext/index.ts +39 -39
- package/package/index.ts +76 -72
- package/package/move/index.ts +3 -0
- package/package/resizeObserver/index.ts +2 -2
- package/package/rotate/index.ts +2 -2
- package/package/ruler/index.ts +2 -2
- package/package/scale/index.ts +3 -0
- package/package/throttle/index.ts +2 -2
- package/package/viewHandler/index.ts +2 -2
- package/package.json +66 -66
- package/src/Canvas.ts +67 -67
- package/src/Eoap.ts +66 -66
- package/src/Geometry.ts +82 -82
- package/src/Matrix4/index.ts +76 -76
- package/src/Matrix4/move.ts +12 -12
- package/src/Matrix4/rotate.ts +15 -15
- package/src/Matrix4/scale.ts +11 -11
- package/src/Matrix4/transform.ts +64 -64
- package/src/Mercator.ts +27 -27
- package/src/SVG.ts +24 -24
- package/src/TreeLayout/index.ts +186 -186
- package/src/WebGL.ts +66 -66
- package/src/animation.ts +98 -98
- package/src/common/assemble.ts +22 -22
- package/src/common/canvas/arc.ts +50 -50
- package/src/common/canvas/config.ts +158 -158
- package/src/common/canvas/gradient.ts +29 -29
- package/src/common/canvas/index.ts +168 -168
- package/src/common/canvas/painter.ts +426 -426
- package/src/common/canvas/texts.ts +18 -18
- package/src/common/geometry/prism-horizontal.ts +33 -33
- package/src/common/geometry/prism-vertical.ts +40 -40
- package/src/common/geometry/sphere-fragment.ts +39 -39
- package/src/common/geometry/tool/circle.ts +11 -11
- package/src/common/mergeOption.ts +6 -6
- package/src/common/setStyle.ts +5 -5
- package/src/common/svg/config.ts +186 -174
- package/src/common/svg/gradient.ts +63 -0
- package/src/common/svg/index.ts +356 -344
- package/src/common/svg/tool.ts +44 -44
- package/src/common/tree/index.ts +25 -25
- package/src/common/tree/toInnerTree.ts +56 -56
- package/src/common/tree/toPlainTree.ts +131 -131
- package/src/common/webgl/buffer.ts +79 -79
- package/src/common/webgl/doDraw.ts +108 -108
- package/src/common/webgl/getColorFactory.ts +26 -26
- package/src/common/webgl/getShader.ts +48 -48
- package/src/common/webgl/getTexture.ts +11 -11
- package/src/common/webgl/getWebGLContext.ts +27 -27
- package/src/common/webgl/index.ts +223 -223
- package/src/common/webgl/shader.ts +75 -75
- package/src/common/webgl/texture.ts +96 -96
- package/src/formatColor.ts +44 -44
- package/src/getLoopColors.ts +42 -42
- package/src/interpolation/Cardinal.ts +110 -110
- package/src/interpolation/Hermite.ts +65 -65
- package/src/move.ts +8 -0
- package/src/resizeObserver.ts +36 -36
- package/src/rotate.ts +7 -7
- package/src/ruler.ts +188 -188
- package/src/scale.ts +7 -0
- package/src/shader/fsColor.c +7 -7
- package/src/shader/fsColors.c +7 -7
- package/src/shader/fsCube.c +8 -8
- package/src/shader/fsImage.c +8 -8
- package/src/shader/vsColor.c +17 -17
- package/src/shader/vsColors.c +13 -13
- package/src/shader/vsCube.c +13 -13
- package/src/shader/vsImage.c +13 -13
- package/src/throttle.ts +51 -51
- package/src/viewHandler.ts +158 -158
- package/types/Buffer.d.ts +23 -23
- package/types/Canvas.d.ts +300 -300
- package/types/CanvasConfig.d.ts +106 -106
- package/types/CanvasOption.d.ts +7 -7
- package/types/Cardinal.d.ts +13 -13
- package/types/Geometry.d.ts +40 -40
- package/types/GeometryOption.d.ts +11 -11
- package/types/GeometryResult.d.ts +18 -18
- package/types/Gradient.d.ts +14 -14
- package/types/Hermite.d.ts +18 -18
- package/types/Map.d.ts +9 -9
- package/types/Matrix4.d.ts +42 -42
- package/types/Object3D.d.ts +114 -114
- package/types/SVG.d.ts +238 -215
- package/types/SVGConfig.d.ts +76 -76
- package/types/Scene3D.d.ts +6 -6
- package/types/Shader.d.ts +21 -21
- package/types/Texture.d.ts +16 -16
- package/types/Tree.d.ts +69 -69
- package/types/TreeConfig.d.ts +24 -24
- package/types/TreeLayout.d.ts +54 -54
- package/types/TreeOption.d.ts +48 -48
- package/types/WebGL.d.ts +38 -38
- package/types/WebGLOption.d.ts +7 -7
- package/types/animation.d.ts +6 -6
- package/types/formatColor.d.ts +2 -2
- package/types/getLoopColors.d.ts +2 -2
- package/types/getWebGLContext.d.ts +2 -2
- package/types/index.d.ts +175 -169
- package/types/move.d.ts +3 -0
- package/types/painterConfig.d.ts +2 -2
- package/types/resizeObserver.d.ts +2 -2
- package/types/rotate.d.ts +2 -2
- package/types/ruler.d.ts +7 -7
- package/types/scale.d.ts +3 -0
- package/types/throttle.d.ts +4 -4
- package/types/throttleOption.d.ts +21 -21
- package/types/viewHandler.d.ts +13 -13
- package/uni-app/ui-canvas.vue +226 -226
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* VISLite JavaScript Library v0.5.2
|
|
2
|
+
* VISLite JavaScript Library v0.5.2
|
|
3
3
|
* git+https://github.com/oi-contrib/VISLite.git
|
|
4
4
|
*
|
|
5
5
|
* Copyright zxl20070701
|
|
6
6
|
* Released under the MIT license
|
|
7
7
|
* https://zxl20070701.github.io/notebook/home.html
|
|
8
8
|
*
|
|
9
|
-
* Publish Date:
|
|
9
|
+
* Publish Date: Sat Nov 04 2023 09:25:44 GMT+0800 (中国标准时间)
|
|
10
10
|
*/
|
|
11
11
|
var t=function(i,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])},t(i,e)};"function"==typeof SuppressedError&&SuppressedError;var i=function(t,i,e,n,r){var o=Math.cos(e),s=Math.sin(e);return[+((n-t)*o-(r-i)*s+t).toFixed(7),+((n-t)*s+(r-i)*o+i).toFixed(7)]};var e=function(t,i,e,n,r){return t.beginPath(),t.translate(e,n),t.rotate(r),t.font=i.fontStyle+" "+i.fontWeight+" "+i.fontSize+"px "+i.fontFamily,t},n=function(t,e,n,r,o,s,_,a){if(o>s){var h=o;o=s,s=h}return _%=2*Math.PI,a>=1.999999*Math.PI||a<=1.999999*-Math.PI?a=2*Math.PI:a%=2*Math.PI,function(t,e,n,r,o,s,_){e<0&&(t+=e,e*=-1);var a,h=[];a=i(0,0,t,o,0),h[0]=a[0],h[1]=a[1],a=i(0,0,e,a[0],a[1]),h[2]=a[0],h[3]=a[1],a=i(0,0,t,s,0),h[4]=a[0],h[5]=a[1],a=i(0,0,e,a[0],a[1]),h[6]=a[0],h[7]=a[1],_(t,t+e,h[0]+n,h[1]+r,h[4]+n,h[5]+r,h[2]+n,h[3]+r,h[6]+n,h[7]+r,.5*(s-o))}(_,a,n,r,o,s,(function(i,_,a,h,l,p,f,u,g,c,y){y<0&&(y=-y),t.beginPath(),t.moveTo(a,h),t.arc(n,r,o,i,_,!1),"round"==e.arcEndCap?t.arc(.5*(f+g),.5*(u+c),y,_-Math.PI,_,!0):"-round"==e.arcEndCap?t.arc(.5*(f+g),.5*(u+c),y,_-Math.PI,_,!1):t.lineTo(g,c),t.arc(n,r,s,_,i,!0),"round"==e.arcStartCap?t.arc(.5*(a+l),.5*(h+p),y,i,i-Math.PI,!0):"-round"==e.arcStartCap?t.arc(.5*(a+l),.5*(h+p),y,i,i-Math.PI,!1):t.lineTo(a,h)})),"butt"==e.arcStartCap&&t.closePath(),t},r=function(t,i,e,n){return t.beginPath(),t.moveTo(i+n,e),t.arc(i,e,n,0,2*Math.PI),t},o=function(t,i,e,n,r){return t.beginPath(),t.rect(i,e,n,r),t};function s(t,i,e,n,r){for(var o=0,s="",_=0;_<i.length;_++)t.measureText(s+i[_]).width>e||/\n$/.test(s)?(r(s,((o+=1)-.5)*n),s=i[_]):_==i.length-1?(o+=1,r(s+i[_],(o-.5)*n)):s+=i[_];return o*n}var _=function(){function t(t,i,e,n){void 0===i&&(i={}),void 0===n&&(n=!1),this.__region=null,this.__onlyRegion=!1,this.__specialConfig={fontSize:16,fontFamily:"sans-serif",fontWeight:400,fontStyle:"normal",arcStartCap:"butt",arcEndCap:"butt"},this.__initConfig={fillStyle:"black",strokeStyle:"black",lineWidth:1,textAlign:"left",textBaseline:"middle",lineDash:[],shadowBlur:0,shadowColor:"black"},this.painter=t.getContext("2d",i),this.__region=e,this.__isPainter=n,this.painter.textBaseline="middle",this.painter.textAlign="left"}return t.prototype.useConfig=function(t,i){if(this.__region&&["fillStyle","strokeStyle","shadowBlur","shadowColor"].indexOf(t)<0&&this.__region.useConfig(t,i),this.__isPainter&&this.__onlyRegion)return this;if("lineDash"==t)this.painter.setLineDash&&this.painter.setLineDash(i);else if(t in this.__specialConfig)"fontSize"==t&&(i=Math.round(i)),this.__specialConfig[t]=i;else{if(!(t in this.__initConfig))throw new Error("Illegal configuration item of painter : "+t+" !");this.painter[t]=i}return this},t.prototype.fillText=function(t,i,n,r){return void 0===r&&(r=0),this.__region&&this.__region.fillText(t,i,n,r),this.__isPainter&&this.__onlyRegion||(this.painter.save(),e(this.painter,this.__specialConfig,i,n,r).fillText(t,0,0),this.painter.restore()),this},t.prototype.strokeText=function(t,i,n,r){return void 0===r&&(r=0),this.__region&&this.__region.strokeText(t,i,n,r),this.__isPainter&&this.__onlyRegion||(this.painter.save(),e(this.painter,this.__specialConfig,i,n,r).strokeText(t,0,0),this.painter.restore()),this},t.prototype.fullText=function(t,i,n,r){return void 0===r&&(r=0),this.__region&&this.__region.fullText(t,i,n,r),this.__isPainter&&this.__onlyRegion||(this.painter.save(),e(this.painter,this.__specialConfig,i,n,r),this.painter.fillText(t,0,0),this.painter.strokeText(t,0,0),this.painter.restore()),this},t.prototype.fillTexts=function(t,i,n,r,o,_){var a=this;void 0===o&&(o=1.2),void 0===_&&(_=0);var h=0;if(this.__region&&(h=this.__region.fillTexts(t,i,n,r,o)),this.__isPainter&&this.__onlyRegion)return h;this.painter.save(),e(this.painter,this.__specialConfig,i,n,_);var l=s(this.painter,t,r,this.__specialConfig.fontSize*o,(function(t,i){a.painter.fillText(t,0,i)}));return this.painter.restore(),l},t.prototype.strokeTexts=function(t,i,n,r,o,_){var a=this;void 0===o&&(o=1.2),void 0===_&&(_=0);var h=0;if(this.__region&&(h=this.__region.fillTexts(t,i,n,r,o)),this.__isPainter&&this.__onlyRegion)return h;this.painter.save(),e(this.painter,this.__specialConfig,i,n,_);var l=s(this.painter,t,r,this.__specialConfig.fontSize*o,(function(t,i){a.painter.strokeText(t,0,i)}));return this.painter.restore(),l},t.prototype.fullTexts=function(t,i,n,r,o,_){var a=this;void 0===o&&(o=1.2),void 0===_&&(_=0);var h=0;if(this.__region&&(h=this.__region.fillTexts(t,i,n,r,o)),this.__isPainter&&this.__onlyRegion)return h;this.painter.save(),e(this.painter,this.__specialConfig,i,n,_);var l=s(this.painter,t,r,this.__specialConfig.fontSize*o,(function(t,i){a.painter.fillText(t,0,i),a.painter.strokeText(t,0,i)}));return this.painter.restore(),l},t.prototype.beginPath=function(){return this.__region&&this.__region.beginPath(),this.__isPainter&&this.__onlyRegion||this.painter.beginPath(),this},t.prototype.closePath=function(){return this.__region&&this.__region.closePath(),this.__isPainter&&this.__onlyRegion||this.painter.closePath(),this},t.prototype.moveTo=function(t,i){return this.__region&&this.__region.moveTo(t,i),this.__isPainter&&this.__onlyRegion||this.painter.moveTo(Math.round(t)+.5,Math.round(i)+.5),this},t.prototype.lineTo=function(t,i){return this.__region&&this.__region.lineTo(t,i),this.__isPainter&&this.__onlyRegion||this.painter.lineTo(Math.round(t)+.5,Math.round(i)+.5),this},t.prototype.arc=function(t,i,e,n,r){return this.__region&&this.__region.arc(t,i,e,n,r),this.__isPainter&&this.__onlyRegion||this.painter.arc(t,i,e,n,n+r,r<0),this},t.prototype.fill=function(){return this.__region&&this.__region.fill(),this.__isPainter&&this.__onlyRegion||this.painter.fill(),this},t.prototype.stroke=function(){return this.__region&&this.__region.stroke(),this.__isPainter&&this.__onlyRegion||this.painter.stroke(),this},t.prototype.full=function(){return this.__region&&this.__region.full(),this.__isPainter&&this.__onlyRegion||(this.painter.fill(),this.painter.stroke()),this},t.prototype.save=function(){return this.__region&&this.__region.save(),this.__isPainter&&this.__onlyRegion||this.painter.save(),this},t.prototype.restore=function(){return this.__region&&this.__region.restore(),this.__isPainter&&this.__onlyRegion||this.painter.restore(),this},t.prototype.clip=function(){return this.__region&&this.__region.clip(),this.__isPainter&&this.__onlyRegion||this.painter.clip(),this},t.prototype.quadraticCurveTo=function(t,i,e,n){return this.__region&&this.__region.quadraticCurveTo(t,i,e,n),this.__isPainter&&this.__onlyRegion||this.painter.quadraticCurveTo(t,i,e,n),this},t.prototype.bezierCurveTo=function(t,i,e,n,r,o){return this.__region&&this.__region.bezierCurveTo(t,i,e,n,r,o),this.__isPainter&&this.__onlyRegion||this.painter.bezierCurveTo(t,i,e,n,r,o),this},t.prototype.clearRect=function(t,i,e,n){return this.__region&&this.__region.clearRect(t,i,e,n),this.__isPainter&&this.__onlyRegion||this.painter.clearRect(t,i,e,n),this},t.prototype.fillArc=function(t,i,e,r,o,s){return this.__region&&this.__region.fillArc(t,i,e,r,o,s),this.__isPainter&&this.__onlyRegion||n(this.painter,this.__specialConfig,t,i,e,r,o,s).fill(),this},t.prototype.strokeArc=function(t,i,e,r,o,s){return this.__region&&this.__region.strokeArc(t,i,e,r,o,s),this.__isPainter&&this.__onlyRegion||n(this.painter,this.__specialConfig,t,i,e,r,o,s).stroke(),this},t.prototype.fullArc=function(t,i,e,r,o,s){return this.__region&&this.__region.fullArc(t,i,e,r,o,s),this.__isPainter&&this.__onlyRegion||(n(this.painter,this.__specialConfig,t,i,e,r,o,s),this.painter.fill(),this.painter.stroke()),this},t.prototype.fillCircle=function(t,i,e){return this.__region&&this.__region.fillCircle(t,i,e),this.__isPainter&&this.__onlyRegion||r(this.painter,t,i,e).fill(),this},t.prototype.strokeCircle=function(t,i,e){return this.__region&&this.__region.strokeCircle(t,i,e),this.__isPainter&&this.__onlyRegion||r(this.painter,t,i,e).stroke(),this},t.prototype.fullCircle=function(t,i,e){return this.__region&&this.__region.fullCircle(t,i,e),this.__isPainter&&this.__onlyRegion||(r(this.painter,t,i,e),this.painter.fill(),this.painter.stroke()),this},t.prototype.fillRect=function(t,i,e,n){return this.__region&&this.__region.fillRect(t,i,e,n),this.__isPainter&&this.__onlyRegion||o(this.painter,t,i,e,n).fill(),this},t.prototype.strokeRect=function(t,i,e,n){return this.__region&&this.__region.strokeRect(t,i,e,n),this.__isPainter&&this.__onlyRegion||o(this.painter,t,i,e,n).stroke(),this},t.prototype.fullRect=function(t,i,e,n){return this.__region&&this.__region.fullRect(t,i,e,n),this.__isPainter&&this.__onlyRegion||(o(this.painter,t,i,e,n),this.painter.fill(),this.painter.stroke()),this},t.prototype.draw=function(){},t}();var a={"font-size":"fontSize","font-family":"fontFamily","font-weight":"fontWeight","font-style":"fontStyle","arc-start-cap":"arcStartCap","arc-end-cap":"arcEndCap"},h=function(i){function n(t,e){var n=i.call(this,t,{},e?new _(e,{willReadFrequently:!0}):null,!0)||this;return n.name="Canvas",n.__regionList={},n.__regionAssemble=function(t,i,e,n){for(var r=[],o=0;o<n;o++)r[o]=t;return function(){for(var o=0;o<n;o++){if(r[o]+e<i){r[o]=+(r[o]+e).toFixed(7);break}o<n-1&&(r[o]=t)}return r}}(0,255,10,3),n.setRegion(""),n}return function(i,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(n,i),n.prototype.config=function(t){for(var i in t){var e=a[i]||i;this.useConfig(e,t[i])}return this},n.prototype.onlyRegion=function(t){return this.__onlyRegion=t,this},n.prototype.setRegion=function(t){if(this.__region)if(t){if(null==this.__regionList[t]){var i=this.__regionAssemble();this.__regionList[t]="rgb("+i[0]+","+i[1]+","+i[2]+")"}this.__region.useConfig("fillStyle",this.__regionList[t])&&this.__region.useConfig("strokeStyle",this.__regionList[t])}else this.__region.useConfig("fillStyle","#000000")&&this.__region.useConfig("strokeStyle","#000000");return this},n.prototype.getRegion=function(t,i){var e=this;return new Promise((function(n,r){var o=e.__region?e.__region.painter.getImageData(t-.5,i-.5,1,1):{data:[0,0,0,0]},s=o.data,_=function(){if(e.__region)for(var t in e.__regionList)if("rgb("+s[0]+","+s[1]+","+s[2]+")"==e.__regionList[t]){n(t);break}n("")};s?_():o.then((function(t){s=t,_()}))}))},n.prototype.textWidth=function(t){this.painter.save(),e(this.painter,this.__specialConfig,0,0,0);var i=this.painter.measureText(t+"").width;return this.painter.restore(),i},n.prototype.getContext=function(t){return void 0===t&&(t=!1),t?this.__region?this.__region.painter:null:this.painter},n.prototype.createLinearGradient=function(t,i,e,n){return function(t,i,e,n,r){var o=t.createLinearGradient(i,e,n,r),s={value:function(){return o},setColor:function(t,i){return o.addColorStop(t,i),s}};return s}(this.painter,t,i,e,n)},n.prototype.createRadialGradient=function(t,i,e){return function(t,i,e,n){var r=t.createRadialGradient(i,e,0,i,e,n),o={value:function(){return r},setColor:function(t,i){return r.addColorStop(t,i),o}};return o}(this.painter,t,i,e)},n.prototype.getColor=function(t,i){var e=this.painter.getImageData(t-.5,i-.5,1,1).data;return"rgba("+e[0]+","+e[1]+","+e[2]+","+e[3]+")"},n}(_);export{h as default};
|