FIX: image quality param
authorjohn@roojs.com <john@roojs.com>
Mon, 31 Dec 2018 06:01:32 +0000 (14:01 +0800)
committerjohn@roojs.com <john@roojs.com>
Mon, 31 Dec 2018 06:01:32 +0000 (14:01 +0800)
Roo/bootstrap/BezierSignature.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index 2eabfc4..808e2c8 100644 (file)
@@ -409,7 +409,7 @@ Roo.extend(Roo.bootstrap.BezierSignature, Roo.bootstrap.Component,  {
         }
         
         // encryption ?
-        return this.canvasEl().dom.toDataURL('image/'+type, false);
+        return this.canvasEl().dom.toDataURL('image/'+type, 1);
     },
     
     drawFromImage: function(img_src)
index abe9740..5422f3a 100644 (file)
@@ -41911,7 +41911,7 @@ Roo.extend(Roo.bootstrap.BezierSignature, Roo.bootstrap.Component,  {
         }
         
         // encryption ?
-        return this.canvasEl().dom.toDataURL('image/'+type, false);
+        return this.canvasEl().dom.toDataURL('image/'+type, 1);
     },
     
     drawFromImage: function(img_src)
index d6568cb..6665fa1 100644 (file)
@@ -1749,7 +1749,7 @@ C.beginPath();this.drawCurveSegment(B.x,B.y,D);C.closePath();C.fillStyle=A;C.fil
 i<E;i+=1){var t=i/E;var tt=t*t;var F=tt*t;var u=1-t;var uu=u*u;var G=uu*u;var x=G*B.startPoint.x;x+=3*uu*t*B.control1.x;x+=3*u*tt*B.control2.x;x+=F*B.endPoint.x;var y=G*B.startPoint.y;y+=3*uu*t*B.control1.y;y+=3*u*tt*B.control2.y;y+=F*B.endPoint.y;var H=B.startWidth+F*D;
 this.drawCurveSegment(x,y,H);}C.closePath();C.fill();},drawCurveSegment:function(x,y,A){var B=this.canvasElCtx();B.moveTo(x,y);B.arc(x,y,A,0,2*Math.PI,false);this.is_empty=false;},clear:function(){var A=this.canvasElCtx();var B=this.canvasEl().dom;A.fillStyle=this.bg_color;
 A.clearRect(0,0,B.width,B.height);A.fillRect(0,0,B.width,B.height);this.curve_data=[];this.reset();this.is_empty=true;},canvasEl:function(){return this.el.select('canvas',true).first();},canvasElCtx:function(){return this.el.select('canvas',true).first().dom.getContext('2d');
-},getImage:function(A){if(this.is_empty){return false;}return this.canvasEl().dom.toDataURL('image/'+A,false);},drawFromImage:function(A){var B=new Image();B.src=A;this.canvasElCtx().drawImage(B,0,0);},Point:(function(){function Point(x,y,A){this.x=x;this.y=y;
+},getImage:function(A){if(this.is_empty){return false;}return this.canvasEl().dom.toDataURL('image/'+A,1);},drawFromImage:function(A){var B=new Image();B.src=A;this.canvasElCtx().drawImage(B,0,0);},Point:(function(){function Point(x,y,A){this.x=x;this.y=y;
 this.time=A||Date.now();}Point.prototype.distanceTo=function(A){return Math.sqrt(Math.pow(this.x-A.x,2)+Math.pow(this.y-A.y,2));};Point.prototype.equals=function(A){return this.x===A.x&&this.y===A.y&&this.time===A.time;};Point.prototype.velocityFrom=function(A){return this.time!==A.time?this.distanceTo(A)/(this.time-A.time):0;
 };return Point;}()),Bezier:(function(){function Bezier(A,B,C,D,E,F){this.startPoint=A;this.control2=B;this.control1=C;this.endPoint=D;this.startWidth=E;this.endWidth=F;}Bezier.fromPoints=function(A,B,C){var c2=this.calculateControlPoints(A[0],A[1],A[2],C).c2;
 var c3=this.calculateControlPoints(A[1],A[2],A[3],C).c1;return new Bezier(A[1],c2,c3,A[2],B.start,B.end);};Bezier.calculateControlPoints=function(s1,s2,s3,A){var B=s1.x-s2.x;var C=s1.y-s2.y;var D=s2.x-s3.x;var E=s2.y-s3.y;var m1={x:(s1.x+s2.x)/2.0,y:(s1.y+s2.y)/2.0}