Commit ce7970f4 authored by Luc Didry's avatar Luc Didry
Browse files

Fix Rick + glitter bug

parent 5031df45
...@@ -957,6 +957,7 @@ function drawOver(ctx, rc, ra, ws, wc, wa, wf, wfs, w, wx, wy, ps, pc, pa, pf, p ...@@ -957,6 +957,7 @@ function drawOver(ctx, rc, ra, ws, wc, wa, wf, wfs, w, wx, wy, ps, pc, pa, pf, p
ctx.translate(rx + (rw / 2), ry + rh / 2); ctx.translate(rx + (rw / 2), ry + rh / 2);
ctx.rotate(rr * Math.PI / 180); ctx.rotate(rr * Math.PI / 180);
ctx.drawImage(rick, -(rw / 2), -(rh / 2), rw, rh); ctx.drawImage(rick, -(rw / 2), -(rh / 2), rw, rh);
ctx.rotate(-rr * Math.PI / 180);
ctx.translate(-(rx + rw / 2), -(ry + rh / 2)); ctx.translate(-(rx + rw / 2), -(ry + rh / 2));
if (gli) { if (gli) {
var glitter = new Image(); var glitter = new Image();
......
...@@ -65,7 +65,7 @@ var U="regular"===n?"":n+" " ...@@ -65,7 +65,7 @@ var U="regular"===n?"":n+" "
if(e.font=U+parseInt(r)+"px '"+l+"'",e.fillStyle=colorToRGBA(s,o),L>0&&(e.strokeStyle=R,e.lineWidth=L,e.strokeText(i,parseInt(c),parseInt(g),z)),e.fillText(i,parseInt(c),parseInt(g),z),U="regular"===u?"":u+" ",e.font=U+parseInt(m)+"px '"+v,e.fillStyle=colorToRGBA(d,h),G>0&&(e.strokeStyle=O,e.lineWidth=G,e.strokeText(f,parseInt(p),parseInt(w),F)),e.fillText(f,parseInt(p),parseInt(w),F),x){var D=new Image if(e.font=U+parseInt(r)+"px '"+l+"'",e.fillStyle=colorToRGBA(s,o),L>0&&(e.strokeStyle=R,e.lineWidth=L,e.strokeText(i,parseInt(c),parseInt(g),z)),e.fillText(i,parseInt(c),parseInt(g),z),U="regular"===u?"":u+" ",e.font=U+parseInt(m)+"px '"+v,e.fillStyle=colorToRGBA(d,h),G>0&&(e.strokeStyle=O,e.lineWidth=G,e.strokeText(f,parseInt(p),parseInt(w),F)),e.fillText(f,parseInt(p),parseInt(w),F),x){var D=new Image
D.src="img/Rick.png",D.onload=function(){C=parseInt(C),S=parseInt(S) D.src="img/Rick.png",D.onload=function(){C=parseInt(C),S=parseInt(S)
var a=D.width*I/100,t=D.height*I/100 var a=D.width*I/100,t=D.height*I/100
if(console.log(a),console.log(t),e.translate(C+a/2,S+t/2),e.rotate(T*Math.PI/180),e.drawImage(D,-a/2,-t/2,a,t),e.translate(-(C+a/2),-(S+t/2)),b){var r=new Image if(console.log(a),console.log(t),e.translate(C+a/2,S+t/2),e.rotate(T*Math.PI/180),e.drawImage(D,-a/2,-t/2,a,t),e.rotate(-T*Math.PI/180),e.translate(-(C+a/2),-(S+t/2)),b){var r=new Image
r.src="img/glitter-calc.png",r.onload=function(){e.drawImage(r,0,0),$("#svg").html(svg.getSerializedSvg())}}else $("#svg").html(svg.getSerializedSvg())}}else if(b){var B=new Image r.src="img/glitter-calc.png",r.onload=function(){e.drawImage(r,0,0),$("#svg").html(svg.getSerializedSvg())}}else $("#svg").html(svg.getSerializedSvg())}}else if(b){var B=new Image
B.src="img/glitter-calc.png",B.onload=function(){e.drawImage(B,0,0),$("#svg").html(svg.getSerializedSvg())}}else $("#svg").html(svg.getSerializedSvg())}function roundRect(e,a,t,r,s,o,l,n){if(void 0===n&&(n=!0),void 0===o&&(o=5),"number"==typeof o)o={tl:o,tr:o,br:o,bl:o} B.src="img/glitter-calc.png",B.onload=function(){e.drawImage(B,0,0),$("#svg").html(svg.getSerializedSvg())}}else $("#svg").html(svg.getSerializedSvg())}function roundRect(e,a,t,r,s,o,l,n){if(void 0===n&&(n=!0),void 0===o&&(o=5),"number"==typeof o)o={tl:o,tr:o,br:o,bl:o}
else{var i={tl:0,tr:0,br:0,bl:0} else{var i={tl:0,tr:0,br:0,bl:0}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment