From 82ba3169f77f87e85dfffac23c02a15c58767afe Mon Sep 17 00:00:00 2001 From: kangax Date: Fri, 27 Jul 2012 02:56:52 +0200 Subject: [PATCH] Make sure text objects have dimensions before they're added to canvas. Closes #158. --- dist/all.js | 14 +++++++++++++- dist/all.min.js | 2 +- dist/all.min.js.gz | Bin 40923 -> 40938 bytes src/text.class.js | 17 ++++++++++++++++- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/dist/all.js b/dist/all.js index 8a845c03..e8ce8909 100644 --- a/dist/all.js +++ b/dist/all.js @@ -12446,10 +12446,22 @@ fabric.Image.filters.GradientTransparency.fromObject = function(object) { this.text = text; this.setOptions(options); this.theta = this.angle * Math.PI / 180; - this.width = this.getWidth(); + this._initDimensions(); this.setCoords(); }, + _initDimensions: function() { + + // render on offscreen canvas, so that object would get dimensions + var canvasEl = fabric.document.createElement('canvas'); + + if (!canvasEl.getContext && typeof G_vmlCanvasManager != 'undefined') { + G_vmlCanvasManager.initElement(canvasEl); + } + + this._render(canvasEl.getContext('2d')); + }, + /** * Creates `stateProperties` list on an instance, and adds `fabric.Text` -specific ones to it * (such as "fontFamily", "fontWeight", etc.) diff --git a/dist/all.min.js b/dist/all.min.js index dec54519..3705429c 100644 --- a/dist/all.min.js +++ b/dist/all.min.js @@ -4,4 +4,4 @@ var fabric=fabric||{version:"0.8.4"};if(typeof exports!="undefined"){exports.fab * Copyright (c) 2009 Simo Kinnunen. * Licensed under the MIT license. */ -var Cufon=(function(){var k=function(){return k.replace.apply(null,arguments)};var u=k.DOM={ready:(function(){var z=false,B={loaded:1,complete:1};var y=[],A=function(){if(z){return}z=true;for(var C;C=y.shift();C()){}};if(fabric.document.addEventListener){fabric.document.addEventListener("DOMContentLoaded",A,false);fabric.window.addEventListener("pageshow",A,false)}if(!fabric.window.opera&&fabric.document.readyState){(function(){B[fabric.document.readyState]?A():setTimeout(arguments.callee,10)})()}if(fabric.document.readyState&&fabric.document.createStyleSheet){(function(){try{fabric.document.body.doScroll("left");A()}catch(C){setTimeout(arguments.callee,1)}})()}o(fabric.window,"load",A);return function(C){if(!arguments.length){A()}else{z?C():y.push(C)}}})()};var l=k.CSS={Size:function(z,y){this.value=parseFloat(z);this.unit=String(z).match(/[a-z%]*$/)[0]||"px";this.convert=function(A){return A/y*this.value};this.convertFrom=function(A){return A/this.value*y};this.toString=function(){return this.value+this.unit}},getStyle:function(y){return new a(y.style)},quotedList:i(function(B){var A=[],z=/\s*((["'])([\s\S]*?[^\\])\2|[^,]+)\s*/g,y;while(y=z.exec(B)){A.push(y[3]||y[1])}return A}),ready:(function(){var A=false;var z=[],B=function(){A=true;for(var D;D=z.shift();D()){}};var y=Object.prototype.propertyIsEnumerable?f("style"):{length:0};var C=f("link");u.ready(function(){var G=0,F;for(var E=0,D=C.length;F=C[E],E=y.length+G){B()}else{setTimeout(arguments.callee,10)}});return function(D){if(A){D()}else{z.push(D)}}})(),supports:function(A,z){var y=fabric.document.createElement("span").style;if(y[A]===undefined){return false}y[A]=z;return y[A]===z},textAlign:function(B,A,y,z){if(A.get("textAlign")=="right"){if(y>0){B=" "+B}}else{if(y400}if(F==500){F=400}for(var G in D){G=parseInt(G,10);if(!C||GA){A=G}H.push(G)}if(FA){F=A}H.sort(function(J,I){return(B?(J>F&&I>F)?JI:(JI:Jz){z=e}L.push(e);e=0;continue}var B=ab.glyphs[ag[aa]]||ab.missingGlyph;if(!B){continue}e+=D=Number(B.w||ab.w)+U}L.push(e);e=Math.max(z,e);var m=[];for(var aa=L.length;aa--;){m[aa]=e-L[aa]}if(D===null){return null}V+=(H.width-D);C+=H.minX;var v,p;if(n){v=J;p=J.firstChild}else{v=fabric.document.createElement("span");v.className="cufon cufon-canvas";v.alt=E;p=fabric.document.createElement("canvas");v.appendChild(p);if(A.printable){var Y=fabric.document.createElement("span");Y.className="cufon-alt";Y.appendChild(fabric.document.createTextNode(E));v.appendChild(Y)}}var ah=v.style;var O=p.style||{};var k=o.convert(H.height-I+T);var af=Math.ceil(k);var S=af/k;p.width=Math.ceil(o.convert(e+V-C)*S);p.height=af;I+=H.minY;O.top=Math.round(o.convert(I-ab.ascent))+"px";O.left=Math.round(o.convert(C))+"px";var j=Math.ceil(o.convert(e*S));var t=j+"px";var s=o.convert(ab.height);var F=(A.lineHeight-1)*o.convert(-ab.ascent/5)*(M-1);Cufon.textOptions.width=j;Cufon.textOptions.height=(s*M)+F;Cufon.textOptions.lines=M;Cufon.textOptions.totalLineHeight=F;if(a){ah.width=t;ah.height=s+"px"}else{ah.paddingLeft=t;ah.paddingBottom=(s-1)+"px"}var ad=Cufon.textOptions.context||p.getContext("2d"),K=af/H.height;Cufon.textOptions.fontAscent=ab.ascent*K;Cufon.textOptions.boundaries=null;for(var w=Cufon.textOptions.shadowOffsets,aa=R.length;aa--;){w[aa]=[R[aa][0]*K,R[aa][1]*K]}ad.save();ad.scale(K,K);ad.translate(-C-((1/K*p.width)/2)+(Cufon.fonts[ab.family].offsetLeft||0),-I-((Cufon.textOptions.height/K)/2)+(Cufon.fonts[ab.family].offsetTop||0));ad.lineWidth=ab.face["underline-thickness"];ad.save();function q(l,i){ad.strokeStyle=i;ad.beginPath();ad.moveTo(0,l);ad.lineTo(e,l);ad.stroke()}var r=Cufon.getTextDecoration(A),u=A.fontStyle==="italic";function ae(){ad.save();ad.fillStyle=A.backgroundColor;var aj=0,an=0,y=[{left:0}];if(A.textAlign==="right"){ad.translate(m[an],0);y[0].left=m[an]*K}else{if(A.textAlign==="center"){ad.translate(m[an]/2,0);y[0].left=m[an]/2*K}}for(var al=0,ak=ag.length;al.cufon-vml-canvas{text-indent:0}@media screen{cvml\\:shape,cvml\\:shadow{behavior:url(#default#VML);display:block;antialias:true;position:absolute}.cufon-vml-canvas{position:absolute;text-align:left}.cufon-vml{display:inline-block;position:relative;vertical-align:middle}.cufon-vml .cufon-alt{position:absolute;left:-10000in;font-size:1px}a .cufon-vml{cursor:pointer}}@media print{.cufon-vml *{display:none}.cufon-vml .cufon-alt{display:inline}}');function c(e,f){return a(e,/(?:em|ex|%)$/i.test(f)?"1em":f)}function a(h,i){if(/px$/i.test(i)){return parseFloat(i)}var g=h.style.left,f=h.runtimeStyle.left;h.runtimeStyle.left=h.currentStyle.left;h.style.left=i;var e=h.style.pixelLeft;h.style.left=g;h.runtimeStyle.left=f;return e}return function(T,z,O,w,D,U,M){var h=(z===null);if(h){z=D.alt}var B=T.viewBox;var j=O.computedFontSize||(O.computedFontSize=new Cufon.CSS.Size(c(U,O.get("fontSize"))+"px",T.baseSize));var L=O.computedLSpacing;if(L==undefined){L=O.get("letterSpacing");O.computedLSpacing=L=(L=="normal")?0:~~j.convertFrom(a(U,L))}var t,m;if(h){t=D;m=D.firstChild}else{t=fabric.document.createElement("span");t.className="cufon cufon-vml";t.alt=z;m=fabric.document.createElement("span");m.className="cufon-vml-canvas";t.appendChild(m);if(w.printable){var R=fabric.document.createElement("span");R.className="cufon-alt";R.appendChild(fabric.document.createTextNode(z));t.appendChild(R)}if(!M){t.appendChild(fabric.document.createElement("cvml:shape"))}}var Z=t.style;var G=m.style;var f=j.convert(B.height),W=Math.ceil(f);var K=W/f;var J=B.minX,I=B.minY;G.height=W;G.top=Math.round(j.convert(I-T.ascent));G.left=Math.round(j.convert(J));Z.height=j.convert(T.height)+"px";var p=Cufon.getTextDecoration(w);var y=O.get("color");var X=Cufon.CSS.textTransform(z,O).split("");var e=0,H=0,q=null;var x,r,A=w.textShadow;for(var S=0,Q=0,P=X.length;Sw?p:(o-n);s(t(currentTime,m,byValue,p));if(o>w||q()){x.onComplete&&x.onComplete();return}k(r)})()}var f=fabric.window.requestAnimationFrame||fabric.window.webkitRequestAnimationFrame||fabric.window.mozRequestAnimationFrame||fabric.window.oRequestAnimationFrame||fabric.window.msRequestAnimationFrame||function(n,m){fabric.window.setTimeout(n,1000/60)};var k=function(){return f.apply(fabric.window,arguments)};function b(n,p,o){if(n){var m=new Image();m.onload=function(){p&&p.call(o,m);m=m.onload=null};m.src=n}else{p&&p.call(o,n)}}function i(o,s){function n(t){return fabric[fabric.util.string.camelize(fabric.util.string.capitalize(t))]}var q=[],p=0,m=o.filter(function(t){return n(t.type).async}).length;var r=this;o.forEach(function(v,u){if(!v.type){return}var t=n(v.type);if(t.async){t.fromObject(v,function(w){q[u]=w;if(++p===m){if(s){s(q)}}})}else{q[u]=t.fromObject(v)}});if(m===0&&s){s(q)}}function a(o,n,p){var m=o.length>1?new fabric.PathGroup(o,n):o[0];if(typeof p!=="undefined"){m.setSourcePath(p)}return m}fabric.util.removeFromArray=j;fabric.util.degreesToRadians=c;fabric.util.toFixed=e;fabric.util.getRandomInt=g;fabric.util.falseFunction=l;fabric.util.animate=d;fabric.util.requestAnimFrame=k;fabric.util.loadImage=b;fabric.util.enlivenObjects=i;fabric.util.groupSVGElements=a})();(function(){var d=Array.prototype.slice;if(!Array.prototype.indexOf){Array.prototype.indexOf=function(g){if(this===void 0||this===null){throw new TypeError()}var h=Object(this),e=h.length>>>0;if(e===0){return -1}var i=0;if(arguments.length>0){i=Number(arguments[1]);if(i!==i){i=0}else{if(i!==0&&i!==(1/0)&&i!==-(1/0)){i=(i>0||-1)*Math.floor(Math.abs(i))}}}if(i>=e){return -1}var f=i>=0?i:Math.max(e-Math.abs(i),0);for(;f>>0;f>>0;g>>0;f>>0;f>>0;g>>0,f=0,h;if(arguments.length>1){h=arguments[1]}else{do{if(f in this){h=this[f++];break}if(++f>=e){throw new TypeError()}}while(true)}for(;f=e){e=h[f][g]}}}else{while(f--){if(h[f]>=e){e=h[f]}}}return e}function c(h,g){if(!h||h.length===0){return undefined}var f=h.length-1,e=g?h[f][g]:h[f];if(g){while(f--){if(h[f][g]/g,">")}fabric.util.string={camelize:b,capitalize:c,escapeXml:a}}());(function(){var c=Array.prototype.slice,a=Function.prototype.apply,b=function(){};if(!Function.prototype.bind){Function.prototype.bind=function(d){var g=this,e=c.call(arguments,1),f;if(e.length){f=function(){return a.call(g,this instanceof b?this:d,e.concat(c.call(arguments)))}}else{f=function(){return a.call(g,this instanceof b?this:d,arguments)}}b.prototype=this.prototype;f.prototype=new b;return f}}})();(function(){var f=Array.prototype.slice,e=function(){};var c=(function(){for(var g in {toString:1}){if(g==="toString"){return false}}return true})();var b=function(g,j,h){for(var i in j){if(i in g.prototype&&typeof g.prototype[i]=="function"){g.prototype[i]=(function(k){return function(){var m=this.constructor.superclass;this.constructor.superclass=h;var l=j[k].apply(this,arguments);this.constructor.superclass=m;if(k!=="initialize"){return l}}})(i)}else{g.prototype[i]=j[i]}if(c){if(j.toString!==Object.prototype.toString){g.prototype.toString=j.toString}if(j.valueOf!==Object.prototype.valueOf){g.prototype.valueOf=j.valueOf}}}};function a(){}function d(){var k=null,j=f.call(arguments,0);if(typeof j[0]==="function"){k=j.shift()}function g(){this.initialize.apply(this,arguments)}g.superclass=k;g.subclasses=[];if(k){a.prototype=k.prototype;g.prototype=new a;k.subclasses.push(g)}for(var h=0,l=j.length;h-1?c(j,l.match(/opacity:\s*(\d?\.?\d*)/)[1]):j}for(var m in l){if(m==="opacity"){c(j,l[m])}else{var k=(m==="float"||m==="cssFloat")?(typeof n.styleFloat==="undefined"?"cssFloat":"styleFloat"):m;n[k]=l[m]}}return j}var h=fabric.document.createElement("div"),g=typeof h.style.opacity==="string",b=typeof h.style.filter==="string",a=fabric.document.defaultView,f=a&&typeof a.getComputedStyle!=="undefined",d=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,c=function(i){return i};if(g){c=function(i,j){i.style.opacity=j;return i}}else{if(b){c=function(i,j){var k=i.style;if(i.currentStyle&&!i.currentStyle.hasLayout){k.zoom=1}if(d.test(k.filter)){j=j>=0.9999?"":("alpha(opacity="+(j*100)+")");k.filter=k.filter.replace(d,j)}else{k.filter+=" alpha(opacity="+(j*100)+")"}return i}}}fabric.util.setStyle=e})();(function(){var h=Array.prototype.slice;function g(j){return typeof j==="string"?fabric.document.getElementById(j):j}function b(j){return h.call(j,0)}try{var i=b(fabric.document.childNodes) instanceof Array}catch(a){}if(!i){b=function(k){var j=new Array(k.length),l=k.length;while(l--){j[l]=k[l]}return j}}function c(k,j){var l=fabric.document.createElement(k);for(var m in j){if(m==="class"){l.className=j[m]}else{if(m==="for"){l.htmlFor=j[m]}else{l.setAttribute(m,j[m])}}}return l}function f(j,k){if((" "+j.className+" ").indexOf(" "+k+" ")===-1){j.className+=(j.className?" ":"")+k}}function e(k,l,j){if(typeof l==="string"){l=c(l,j)}if(k.parentNode){k.parentNode.replaceChild(l,k)}l.appendChild(k);return l}function d(k){var j=0,l=0;do{j+=k.offsetTop||0;l+=k.offsetLeft||0;k=k.offsetParent}while(k);return({left:l,top:j})}(function(){var k=fabric.document.documentElement.style;var l="userSelect" in k?"userSelect":"MozUserSelect" in k?"MozUserSelect":"WebkitUserSelect" in k?"WebkitUserSelect":"KhtmlUserSelect" in k?"KhtmlUserSelect":"";function m(n){if(typeof n.onselectstart!=="undefined"){n.onselectstart=fabric.util.falseFunction}if(l){n.style[l]="none"}else{if(typeof n.unselectable=="string"){n.unselectable="on"}}return n}function j(n){if(typeof n.onselectstart!=="undefined"){n.onselectstart=null}if(l){n.style[l]=""}else{if(typeof n.unselectable=="string"){n.unselectable=""}}return n}fabric.util.makeElementUnselectable=m;fabric.util.makeElementSelectable=j})();(function(){function j(k,o){var m=fabric.document.getElementsByTagName("head")[0],l=fabric.document.createElement("script"),n=true;l.type="text/javascript";l.setAttribute("runat","server");l.onload=l.onreadystatechange=function(p){if(n){if(typeof this.readyState=="string"&&this.readyState!=="loaded"&&this.readyState!=="complete"){return}n=false;o(p||fabric.window.event);l=l.onload=l.onreadystatechange=null}};l.src=k;m.appendChild(l)}fabric.util.getScript=j})();fabric.util.getById=g;fabric.util.toArray=b;fabric.util.makeElement=c;fabric.util.addClass=f;fabric.util.wrapElement=e;fabric.util.getElementOffset=d})();(function(){function d(e,f){return e+(/\?/.test(e)?"&":"?")+f}var c=(function(){var h=[function(){return new ActiveXObject("Microsoft.XMLHTTP")},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml2.XMLHTTP.3.0")},function(){return new XMLHttpRequest()}];for(var e=h.length;e--;){try{var g=h[e]();if(g){return h[e]}}catch(f){}}})();function a(){}function b(g,f){f||(f={});var j=f.method?f.method.toUpperCase():"GET",i=f.onComplete||function(){},h=c(),e;h.onreadystatechange=function(){if(h.readyState===4){i(h);h.onreadystatechange=a}};if(j==="GET"){e=null;if(typeof f.parameters=="string"){g=d(g,f.parameters)}}h.open(j,g,true);if(j==="POST"||j==="PUT"){h.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}h.send(e);return h}fabric.util.request=b})();(function(){function d(F,E,H,G){return H*(F/=G)*F+E}function l(F,E,H,G){return -H*(F/=G)*(F-2)+E}function r(F,E,H,G){if((F/=G/2)<1){return H/2*F*F+E}return -H/2*((--F)*(F-2)-1)+E}function B(F,E,H,G){return H*(F/=G)*F*F+E}function q(F,E,H,G){return H*((F=F/G-1)*F*F+1)+E}function u(F,E,H,G){if((F/=G/2)<1){return H/2*F*F*F+E}return H/2*((F-=2)*F*F+2)+E}function t(F,E,H,G){return H*(F/=G)*F*F*F+E}function g(F,E,H,G){return -H*((F=F/G-1)*F*F*F-1)+E}function k(F,E,H,G){if((F/=G/2)<1){return H/2*F*F*F*F+E}return -H/2*((F-=2)*F*F*F-2)+E}function y(F,E,H,G){return H*(F/=G)*F*F*F*F+E}function j(F,E,H,G){return H*((F=F/G-1)*F*F*F*F+1)+E}function n(F,E,H,G){if((F/=G/2)<1){return H/2*F*F*F*F*F+E}return H/2*((F-=2)*F*F*F*F+2)+E}function f(F,E,H,G){return -H*Math.cos(F/G*(Math.PI/2))+H+E}function o(F,E,H,G){return H*Math.sin(F/G*(Math.PI/2))+E}function v(F,E,H,G){return -H/2*(Math.cos(Math.PI*F/G)-1)+E}function D(F,E,H,G){return(F==0)?E:H*Math.pow(2,10*(F/G-1))+E}function c(F,E,H,G){return(F==G)?E+H:H*(-Math.pow(2,-10*F/G)+1)+E}function i(F,E,H,G){if(F==0){return E}if(F==G){return E+H}if((F/=G/2)<1){return H/2*Math.pow(2,10*(F-1))+E}return H/2*(-Math.pow(2,-10*--F)+2)+E}function h(F,E,H,G){return -H*(Math.sqrt(1-(F/=G)*F)-1)+E}function p(F,E,H,G){return H*Math.sqrt(1-(F=F/G-1)*F)+E}function x(F,E,H,G){if((F/=G/2)<1){return -H/2*(Math.sqrt(1-F*F)-1)+E}return H/2*(Math.sqrt(1-(F-=2)*F)+1)+E}function s(G,E,K,J){var H=1.70158;var I=0;var F=K;if(G==0){return E}if((G/=J)==1){return E+K}if(!I){I=J*0.3}if(F-1;w=w.split(/\s+/);var u=[];if(y){for(var v=0,t=w.length;v/i,""))}if(!w.documentElement){return}h.parseSVGDocument(w.documentElement,function(z,y){k.set(t,{objects:h.util.array.invoke(z,"toObject"),options:y});v(z,y)})}}function b(v){var u=v.objects,t=v.options;u=u.map(function(w){return h[f(w.type)].fromObject(w)});return({objects:u,options:t})}function n(t,w){t=t.trim();var u;if(typeof DOMParser!=="undefined"){var v=new DOMParser();if(v&&v.parseFromString){u=v.parseFromString(t,"text/xml")}}else{if(h.window.ActiveXObject){var u=new ActiveXObject("Microsoft.XMLDOM");u.async="false";u.loadXML(t.replace(//i,""))}}h.parseSVGDocument(u.documentElement,function(y,x){w(y,x)})}function m(w){var u="";for(var v=0,t=w.length;v",'",""].join("")}return u}p(h,{parseAttributes:e,parseElements:g,parseStyleAttribute:i,parsePointsAttribute:s,getCSSRules:d,loadSVGFromURL:c,loadSVGFromString:n,createSVGFontFacesMarkup:m})})(typeof exports!="undefined"?exports:this);(function(){function c(h){var g=h.getAttribute("style");if(g){var k=g.split(/\s*;\s*/);if(k[k.length-1]===""){k.pop()}for(var f=k.length;f--;){var e=k[f].split(/\s*:\s*/),d=e[0].trim(),j=e[1].trim();if(d==="stop-color"){return j}}}}fabric.Gradient={create:function(l,m){m||(m={});var f=m.x1||0,k=m.y1||0,e=m.x2||l.canvas.width,i=m.y2||0,g=m.colorStops;var j=l.createLinearGradient(f,k,e,i);for(var h in g){var d=g[h];j.addColorStop(parseFloat(h),d)}return j},fromElement:function(d,m,l){var j=d.getElementsByTagName("stop"),d,f,e={},g,k={x1:d.getAttribute("x1")||0,y1:d.getAttribute("y1")||0,x2:d.getAttribute("x2")||"100%",y2:d.getAttribute("y2")||0};for(var h=j.length;h--;){d=j[h];f=d.getAttribute("offset");f=parseFloat(f)/(/%$/.test(f)?100:1);e[f]=c(d)||d.getAttribute("stop-color")}a(l,k);return fabric.Gradient.create(m,{x1:k.x1,y1:k.y1,x2:k.x2,y2:k.y2,colorStops:e})},forObject:function(g,d,e){e||(e={});a(g,e);var f=fabric.Gradient.create(d,{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,colorStops:e.colorStops});return f}};function a(f,e){for(var g in e){if(typeof e[g]==="string"&&/^\d+%$/.test(e[g])){var d=parseFloat(e[g],10);if(g==="x1"||g==="x2"){e[g]=f.width*d/100}else{if(g==="y1"||g==="y2"){e[g]=f.height*d/100}}}if(g==="x1"||g==="x2"){e[g]-=f.width/2}else{if(g==="y1"||g==="y2"){e[g]-=f.height/2}}}}function b(j){var f=j.getElementsByTagName("linearGradient"),d=j.getElementsByTagName("radialGradient"),g,h={};for(var e=f.length;e--;){g=f[e];h[g.id]=g}for(var e=d.length;e--;){g=d[e];h[g.id]=g}return h}fabric.getGradientDefs=b})();(function(b){var c=b.fabric||(b.fabric={});if(c.Point){c.warn("fabric.Point is already defined");return}c.Point=a;function a(d,e){if(arguments.length>0){this.init(d,e)}}a.prototype={constructor:a,init:function(d,e){this.x=d;this.y=e},add:function(d){return new a(this.x+d.x,this.y+d.y)},addEquals:function(d){this.x+=d.x;this.y+=d.y;return this},scalarAdd:function(d){return new a(this.x+d,this.y+d)},scalarAddEquals:function(d){this.x+=d;this.y+=d;return this},subtract:function(d){return new a(this.x-d.x,this.y-d.y)},subtractEquals:function(d){this.x-=d.x;this.y-=d.y;return this},scalarSubtract:function(d){return new a(this.x-d,this.y-d)},scalarSubtractEquals:function(d){this.x-=d;this.y-=d;return this},multiply:function(d){return new a(this.x*d,this.y*d)},multiplyEquals:function(d){this.x*=d;this.y*=d;return this},divide:function(d){return new a(this.x/d,this.y/d)},divideEquals:function(d){this.x/=d;this.y/=d;return this},eq:function(d){return(this.x==d.x&&this.y==d.y)},lt:function(d){return(this.xd.x&&this.y>d.y)},gte:function(d){return(this.x>=d.x&&this.y>=d.y)},lerp:function(e,d){return new a(this.x+(e.x-this.x)*d,this.y+(e.y-this.y)*d)},distanceFrom:function(f){var e=this.x-f.x,d=this.y-f.y;return Math.sqrt(e*e+d*d)},min:function(d){return new a(Math.min(this.x,d.x),Math.min(this.y,d.y))},max:function(d){return new a(Math.max(this.x,d.x),Math.max(this.y,d.y))},toString:function(){return this.x+","+this.y},setXY:function(d,e){this.x=d;this.y=e},setFromPoint:function(d){this.x=d.x;this.y=d.y},swap:function(e){var d=this.x,f=this.y;this.x=e.x;this.y=e.y;e.x=d;e.y=f}}})(typeof exports!="undefined"?exports:this);(function(a){var b=a.fabric||(a.fabric={});if(b.Intersection){b.warn("fabric.Intersection is already defined");return}function c(d){if(arguments.length>0){this.init(d)}}b.Intersection=c;b.Intersection.prototype={init:function(d){this.status=d;this.points=[]},appendPoint:function(d){this.points.push(d)},appendPoints:function(d){this.points=this.points.concat(d)}};b.Intersection.intersectLineLine=function(h,f,l,k){var m,i=(k.x-l.x)*(h.y-l.y)-(k.y-l.y)*(h.x-l.x),j=(f.x-h.x)*(h.y-l.y)-(f.y-h.y)*(h.x-l.x),g=(k.y-l.y)*(f.x-h.x)-(k.x-l.x)*(f.y-h.y);if(g!=0){var e=i/g,d=j/g;if(0<=e&&e<=1&&0<=d&&d<=1){m=new c("Intersection");m.points.push(new b.Point(h.x+e*(f.x-h.x),h.y+e*(f.y-h.y)))}else{m=new c("No Intersection")}}else{if(i==0||j==0){m=new c("Coincident")}else{m=new c("Parallel")}}return m};b.Intersection.intersectLinePolygon=function(e,d,l){var m=new c("No Intersection"),f=l.length;for(var h=0;h0){m.status="Intersection"}return m};b.Intersection.intersectPolygonPolygon=function(j,h){var f=new c("No Intersection"),l=j.length;for(var k=0;k0){f.status="Intersection"}return f};b.Intersection.intersectPolygonRectangle=function(n,e,d){var g=e.min(d),m=e.max(d),f=new b.Point(m.x,g.y),l=new b.Point(g.x,m.y),k=c.intersectLinePolygon(g,f,n),j=c.intersectLinePolygon(f,m,n),i=c.intersectLinePolygon(m,l,n),h=c.intersectLinePolygon(l,g,n),o=new c("No Intersection");o.appendPoints(k.points);o.appendPoints(j.points);o.appendPoints(i.points);o.appendPoints(h.points);if(o.points.length>0){o.status="Intersection"}return o}})(typeof exports!="undefined"?exports:this);(function(a){var b=a.fabric||(a.fabric={});if(b.Color){b.warn("fabric.Color is already defined.");return}function c(d){if(!d){this.setSource([0,0,0,1])}else{this._tryParsingColor(d)}}b.Color=c;b.Color.prototype={_tryParsingColor:function(d){var e=c.sourceFromHex(d);if(!e){e=c.sourceFromRgb(d)}if(e){this.setSource(e)}},getSource:function(){return this._source},setSource:function(d){this._source=d},toRgb:function(){var d=this.getSource();return"rgb("+d[0]+","+d[1]+","+d[2]+")"},toRgba:function(){var d=this.getSource();return"rgba("+d[0]+","+d[1]+","+d[2]+","+d[3]+")"},toHex:function(){var h=this.getSource();var f=h[0].toString(16);f=(f.length==1)?("0"+f):f;var e=h[1].toString(16);e=(e.length==1)?("0"+e):e;var d=h[2].toString(16);d=(d.length==1)?("0"+d):d;return f.toUpperCase()+e.toUpperCase()+d.toUpperCase()},getAlpha:function(){return this.getSource()[3]},setAlpha:function(e){var d=this.getSource();d[3]=e;this.setSource(d);return this},toGrayscale:function(){var f=this.getSource(),e=parseInt((f[0]*0.3+f[1]*0.59+f[2]*0.11).toFixed(0),10),d=f[3];this.setSource([e,e,e,d]);return this},toBlackWhite:function(d){var g=this.getSource(),f=(g[0]*0.3+g[1]*0.59+g[2]*0.11).toFixed(0),e=g[3],d=d||127;f=(Number(f)','',"',"Created with Fabric.js ",fabric.version,"",fabric.createSVGFontFacesMarkup(this.getObjects())];if(this.backgroundImage){h.push('')}for(var j=0,k=this.getObjects(),g=k.length;j");return h.join("")},isEmpty:function(){return this._objects.length===0},remove:function(g){e(this._objects,g);if(this.getActiveObject()===g){this.fire("before:selection:cleared",{target:g});this.discardActiveObject();this.fire("selection:cleared")}this.renderAll();return g},sendToBack:function(g){e(this._objects,g);this._objects.unshift(g);return this.renderAll()},bringToFront:function(g){e(this._objects,g);this._objects.push(g);return this.renderAll()},sendBackwards:function(j){var h=this._objects.indexOf(j),g=h;if(h!==0){for(var k=h-1;k>=0;--k){if(j.intersectsWithObject(this._objects[k])||j.isContainedWithinObject(this._objects[k])){g=k;break}}e(this._objects,j);this._objects.splice(g,0,j)}return this.renderAll()},bringForward:function(k){var n=this.getObjects(),h=n.indexOf(k),g=h;if(h!==n.length-1){for(var m=h+1,j=this._objects.length;m"};f(fabric.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',toGrayscale:function(l){var k=l.getContext("2d"),g=k.getImageData(0,0,l.width,l.height),p=g.data,m=g.width,r=g.height,q,h,o,n;for(o=0;o0)?0:-v),r.ey-((u>0)?0:-u),t,s);this.contextTop.lineWidth=this.selectionLineWidth;this.contextTop.strokeStyle=this.selectionBorderColor;this.contextTop.strokeRect(r.ex+a-((v>0)?0:t),r.ey+a-((u>0)?0:s),t,s)},_findSelectedObjects:function(x){var y,t,D=[],s=this._groupSelector.ex,C=this._groupSelector.ey,r=s+this._groupSelector.left,A=C+this._groupSelector.top,z,w=new fabric.Point(f(s,r),f(C,A)),B=new fabric.Point(l(s,r),l(C,A));for(var u=0,v=this._objects.length;u1){var D=new fabric.Group(D);this.setActiveGroup(D);D.saveCoords();this.fire("selection:created",{target:D})}}this.renderAll()},findTarget:function(v,s){var u,w=this.getPointer(v);var t=this.getActiveGroup();if(t&&!s&&this.containsPoint(v,t)){u=t;return u}for(var r=this._objects.length;r--;){if(this._objects[r]&&this.containsPoint(v,this._objects[r])){u=this._objects[r];this.relatedTarget=u;break}}if(u&&u.selectable){return u}},getPointer:function(r){var s=q(r);return{x:s.x-this._offset.left,y:s.y-this._offset.top}},_createUpperCanvas:function(){this.upperCanvasEl=this._createCanvasElement();this.upperCanvasEl.className="upper-canvas";this.wrapperEl.appendChild(this.upperCanvasEl);this._applyCanvasStyle(this.upperCanvasEl);this.contextTop=this.upperCanvasEl.getContext("2d")},_initWrapperElement:function(){this.wrapperEl=fabric.util.wrapElement(this.lowerCanvasEl,"div",{"class":this.containerClass});fabric.util.setStyle(this.wrapperEl,{width:this.getWidth()+"px",height:this.getHeight()+"px",position:"relative"});fabric.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(s){var t=this.getWidth()||s.width,r=this.getHeight()||s.height;fabric.util.setStyle(s,{position:"absolute",width:t+"px",height:r+"px",left:0,top:0});s.width=t;s.height=r;fabric.util.makeElementUnselectable(s)},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},setActiveObject:function(r,s){if(this._activeObject){this._activeObject.setActive(false)}this._activeObject=r;r.setActive(true);this.renderAll();this.fire("object:selected",{target:r,e:s});r.fire("selected",{e:s});return this},getActiveObject:function(){return this._activeObject},discardActiveObject:function(){if(this._activeObject){this._activeObject.setActive(false)}this._activeObject=null;return this},setActiveGroup:function(r){this._activeGroup=r;r&&r.setActive(true);return this},getActiveGroup:function(){return this._activeGroup},discardActiveGroup:function(){var r=this.getActiveGroup();if(r){r.destroy()}return this.setActiveGroup(null)},deactivateAll:function(){var s=this.getObjects(),t=0,r=s.length;for(;t1)?q.apply(this,o.call(arguments,1)):q.call(this)},initialize:function(i){i&&this.setOptions(i)},setOptions:function(q){var r=this.stateProperties.length,s;while(r--){s=this.stateProperties[r];if(s in q){this.set(s,q[s])}}},transform:function(i){i.globalAlpha=this.opacity;i.translate(this.left,this.top);i.rotate(this.theta);i.scale(this.scaleX*(this.flipX?-1:1),this.scaleY*(this.flipY?-1:1))},toObject:function(){var i={type:this.type,left:c(this.left,this.NUM_FRACTION_DIGITS),top:c(this.top,this.NUM_FRACTION_DIGITS),width:c(this.width,this.NUM_FRACTION_DIGITS),height:c(this.height,this.NUM_FRACTION_DIGITS),fill:this.fill,overlayFill:this.overlayFill,stroke:this.stroke,strokeWidth:this.strokeWidth,scaleX:c(this.scaleX,this.NUM_FRACTION_DIGITS),scaleY:c(this.scaleY,this.NUM_FRACTION_DIGITS),angle:c(this.getAngle(),this.NUM_FRACTION_DIGITS),flipX:this.flipX,flipY:this.flipY,opacity:c(this.opacity,this.NUM_FRACTION_DIGITS),selectable:this.selectable,hasControls:this.hasControls,hasBorders:this.hasBorders,hasRotatingPoint:this.hasRotatingPoint};if(!this.includeDefaultValues){i=this._removeDefaultValues(i)}return i},toDatalessObject:function(){return this.toObject()},getSvgStyles:function(){return["stroke: ",(this.stroke?this.stroke:"none"),"; ","stroke-width: ",(this.strokeWidth?this.strokeWidth:"0"),"; ","fill: ",(this.fill?this.fill:"none"),"; ","opacity: ",(this.opacity?this.opacity:"1"),";"].join("")},getSvgTransform:function(){var i=this.getAngle();return["translate(",c(this.left,2)," ",c(this.top,2),")",i!==0?(" rotate("+c(i,2)+")"):"",(this.scaleX===1&&this.scaleY===1)?"":(" scale("+c(this.scaleX,2)+" "+c(this.scaleY,2)+")")].join("")},_removeDefaultValues:function(q){var i=d.Object.prototype.options;if(i){this.stateProperties.forEach(function(r){if(q[r]===i[r]){delete q[r]}})}return q},isActive:function(){return !!this.active},setActive:function(i){this.active=!!i;return this},toString:function(){return"#"},set:function(q,i){var s=(q==="scaleX"||q==="scaleY")&&ir.x&&s.xr.y&&u.y=v)&&(s.d.y>=v)){continue}if((s.o.x==s.d.x)&&(s.o.x>=w)){x=s.o.x;u=v}else{z=0;y=(s.d.y-s.o.y)/(s.d.x-s.o.x);r=v-z*w;q=s.o.y-y*s.o.x;x=-(r-q)/(z-y);u=r+z*x}if(x>=w){t+=1}if(t==2){break}}return t},_getImageLines:function(r,q){return{topline:{o:r.tl,d:r.tr},rightline:{o:r.tr,d:r.br},bottomline:{o:r.br,d:r.bl},leftline:{o:r.bl,d:r.tl}}},_setCornerCoords:function(){var u=this.oCoords,q=b(45-this.getAngle()),s=Math.sqrt(2*Math.pow(this.cornersize,2))/2,i=s*Math.cos(q),r=s*Math.sin(q),v=Math.sin(this.theta),t=Math.cos(this.theta);u.tl.corner={tl:{x:u.tl.x-r,y:u.tl.y-i},tr:{x:u.tl.x+i,y:u.tl.y-r},bl:{x:u.tl.x-i,y:u.tl.y+r},br:{x:u.tl.x+r,y:u.tl.y+i}};u.tr.corner={tl:{x:u.tr.x-r,y:u.tr.y-i},tr:{x:u.tr.x+i,y:u.tr.y-r},br:{x:u.tr.x+r,y:u.tr.y+i},bl:{x:u.tr.x-i,y:u.tr.y+r}};u.bl.corner={tl:{x:u.bl.x-r,y:u.bl.y-i},bl:{x:u.bl.x-i,y:u.bl.y+r},br:{x:u.bl.x+r,y:u.bl.y+i},tr:{x:u.bl.x+i,y:u.bl.y-r}};u.br.corner={tr:{x:u.br.x+i,y:u.br.y-r},bl:{x:u.br.x-i,y:u.br.y+r},br:{x:u.br.x+r,y:u.br.y+i},tl:{x:u.br.x-r,y:u.br.y-i}};u.ml.corner={tl:{x:u.ml.x-r,y:u.ml.y-i},tr:{x:u.ml.x+i,y:u.ml.y-r},bl:{x:u.ml.x-i,y:u.ml.y+r},br:{x:u.ml.x+r,y:u.ml.y+i}};u.mt.corner={tl:{x:u.mt.x-r,y:u.mt.y-i},tr:{x:u.mt.x+i,y:u.mt.y-r},bl:{x:u.mt.x-i,y:u.mt.y+r},br:{x:u.mt.x+r,y:u.mt.y+i}};u.mr.corner={tl:{x:u.mr.x-r,y:u.mr.y-i},tr:{x:u.mr.x+i,y:u.mr.y-r},bl:{x:u.mr.x-i,y:u.mr.y+r},br:{x:u.mr.x+r,y:u.mr.y+i}};u.mb.corner={tl:{x:u.mb.x-r,y:u.mb.y-i},tr:{x:u.mb.x+i,y:u.mb.y-r},bl:{x:u.mb.x-i,y:u.mb.y+r},br:{x:u.mb.x+r,y:u.mb.y+i}};u.mtr.corner={tl:{x:u.mtr.x-r+(v*this.rotatingPointOffset),y:u.mtr.y-i-(t*this.rotatingPointOffset)},tr:{x:u.mtr.x+i+(v*this.rotatingPointOffset),y:u.mtr.y-r-(t*this.rotatingPointOffset)},bl:{x:u.mtr.x-i+(v*this.rotatingPointOffset),y:u.mtr.y+r-(t*this.rotatingPointOffset)},br:{x:u.mtr.x+r+(v*this.rotatingPointOffset),y:u.mtr.y+i-(t*this.rotatingPointOffset)}}},toGrayscale:function(){var i=this.get("fill");if(i){this.set("overlayFill",new d.Color(i).toGrayscale().toRgb())}return this},complexity:function(){return 0},toJSON:function(){return this.toObject()},setGradientFill:function(i,q){this.set("fill",d.Gradient.forObject(this,i,q))},animate:function(q,s,i){var r=this;i||(i={});if(!("from" in i)){i.from=this.get(q)}if(/[+-]/.test((s+"").charAt(0))){s=this.get(q)+parseFloat(s)}d.util.animate({startValue:i.from,endValue:s,byValue:i.by,easing:i.easing,duration:i.duration,onChange:function(t){r.set(q,t);i.onChange&&i.onChange()},onComplete:function(){r.setCoords();i.onComplete&&i.onComplete()}})}});d.Object.prototype.rotate=d.Object.prototype.setAngle;var j=d.Object.prototype;for(var g=j.stateProperties.length;g--;){var h=j.stateProperties[g],e=h.charAt(0).toUpperCase()+h.slice(1),f="set"+e,n="get"+e;if(!j[n]){j[n]=(function(i){return new Function('return this.get("'+i+'")')})(h)}if(!j[f]){j[f]=(function(i){return new Function("value",'return this.set("'+i+'", value)')})(h)}}l(d.Object.prototype,d.Observable)})(typeof exports!="undefined"?exports:this);(function(b){var c=b.fabric||(b.fabric={}),e=c.util.object.extend,d=c.Object.prototype.set,a={x1:1,x2:1,y1:1,y2:1};if(c.Line){c.warn("fabric.Line is already defined");return}c.Line=c.util.createClass(c.Object,{type:"line",initialize:function(g,f){if(!g){g=[0,0,0,0]}this.callSuper("initialize",f);this.set("x1",g[0]);this.set("y1",g[1]);this.set("x2",g[2]);this.set("y2",g[3]);this._setWidthHeight(f)},_setWidthHeight:function(f){f||(f={});this.set("width",(this.x2-this.x1)||1);this.set("height",(this.y2-this.y1)||1);this.set("left","left" in f?f.left:(this.x1+this.width/2));this.set("top","top" in f?f.top:(this.y1+this.height/2))},set:function(f,g){d.call(this,f,g);if(f in a){this._setWidthHeight()}return this},_render:function(f){f.beginPath();f.moveTo(this.width===1?0:(-this.width/2),this.height===1?0:(-this.height/2));f.lineTo(this.width===1?0:(this.width/2),this.height===1?0:(this.height/2));f.lineWidth=this.strokeWidth;var g=f.strokeStyle;f.strokeStyle=f.fillStyle;f.stroke();f.strokeStyle=g},complexity:function(){return 1},toObject:function(){return e(this.callSuper("toObject"),{x1:this.get("x1"),y1:this.get("y1"),x2:this.get("x2"),y2:this.get("y2")})},toSVG:function(){return[""].join("")}});c.Line.ATTRIBUTE_NAMES="x1 y1 x2 y2 stroke stroke-width transform".split(" ");c.Line.fromElement=function(g,f){var i=c.parseAttributes(g,c.Line.ATTRIBUTE_NAMES);var h=[i.x1||0,i.y1||0,i.x2||0,i.y2||0];return new c.Line(h,e(i,f))};c.Line.fromObject=function(f){var g=[f.x1,f.y1,f.x2,f.y2];return new c.Line(g,f)}})(typeof exports!="undefined"?exports:this);(function(a){var b=a.fabric||(a.fabric={}),d=Math.PI*2,e=b.util.object.extend;if(b.Circle){b.warn("fabric.Circle is already defined.");return}b.Circle=b.util.createClass(b.Object,{type:"circle",initialize:function(f){f=f||{};this.set("radius",f.radius||0);this.callSuper("initialize",f);var g=this.get("radius")*2;this.set("width",g).set("height",g)},toObject:function(){return e(this.callSuper("toObject"),{radius:this.get("radius")})},toSVG:function(){return('')},_render:function(f,g){f.beginPath();f.globalAlpha*=this.opacity;f.arc(g?this.left:0,g?this.top:0,this.radius,0,d,false);f.closePath();if(this.fill){f.fill()}if(this.stroke){f.stroke()}},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(f){this.radius=f;this.set("width",f*2).set("height",f*2)},complexity:function(){return 1}});b.Circle.ATTRIBUTE_NAMES="cx cy r fill fill-opacity opacity stroke stroke-width transform".split(" ");b.Circle.fromElement=function(g,f){f||(f={});var h=b.parseAttributes(g,b.Circle.ATTRIBUTE_NAMES);if(!c(h)){throw Error("value of `r` attribute is required and can not be negative")}if("left" in h){h.left-=(f.width/2)||0}if("top" in h){h.top-=(f.height/2)||0}return new b.Circle(e(h,f))};function c(f){return(("radius" in f)&&(f.radius>0))}b.Circle.fromObject=function(f){return new b.Circle(f)}})(typeof exports!="undefined"?exports:this);(function(a){var b=a.fabric||(a.fabric={});if(b.Triangle){b.warn("fabric.Triangle is already defined");return}b.Triangle=b.util.createClass(b.Object,{type:"triangle",initialize:function(c){c=c||{};this.callSuper("initialize",c);this.set("width",c.width||100).set("height",c.height||100)},_render:function(c){var d=this.width/2,e=this.height/2;c.beginPath();c.moveTo(-d,e);c.lineTo(0,-e);c.lineTo(d,e);c.closePath();if(this.fill){c.fill()}if(this.stroke){c.stroke()}},complexity:function(){return 1},toSVG:function(){var c=this.width/2,d=this.height/2;var e=[-c+" "+d,"0 "+-d,c+" "+d].join(",");return''}});b.Triangle.fromObject=function(c){return new b.Triangle(c)}})(typeof exports!="undefined"?exports:this);(function(a){var b=a.fabric||(a.fabric={}),c=Math.PI*2,d=b.util.object.extend;if(b.Ellipse){b.warn("fabric.Ellipse is already defined.");return}b.Ellipse=b.util.createClass(b.Object,{type:"ellipse",initialize:function(e){e=e||{};this.callSuper("initialize",e);this.set("rx",e.rx||0);this.set("ry",e.ry||0);this.set("width",this.get("rx")*2);this.set("height",this.get("ry")*2)},toObject:function(){return d(this.callSuper("toObject"),{rx:this.get("rx"),ry:this.get("ry")})},toSVG:function(){return[""].join("")},render:function(e,f){if(this.rx===0||this.ry===0){return}return this.callSuper("render",e,f)},_render:function(e,f){e.beginPath();e.save();e.globalAlpha*=this.opacity;e.transform(1,0,0,this.ry/this.rx,0,0);e.arc(f?this.left:0,f?this.top:0,this.rx,0,c,false);if(this.stroke){e.stroke()}if(this.fill){e.fill()}e.restore()},complexity:function(){return 1}});b.Ellipse.ATTRIBUTE_NAMES="cx cy rx ry fill fill-opacity opacity stroke stroke-width transform".split(" ");b.Ellipse.fromElement=function(f,e){e||(e={});var g=b.parseAttributes(f,b.Ellipse.ATTRIBUTE_NAMES);if("left" in g){g.left-=(e.width/2)||0}if("top" in g){g.top-=(e.height/2)||0}return new b.Ellipse(d(g,e))};b.Ellipse.fromObject=function(e){return new b.Ellipse(e)}})(typeof exports!="undefined"?exports:this);(function(b){var c=b.fabric||(b.fabric={});if(c.Rect){console.warn("fabric.Rect is already defined");return}c.Rect=c.util.createClass(c.Object,{type:"rect",options:{rx:0,ry:0},initialize:function(d){this._initStateProperties();this.callSuper("initialize",d);this._initRxRy()},_initStateProperties:function(){this.stateProperties=this.stateProperties.concat(["rx","ry"])},_initRxRy:function(){if(this.rx&&!this.ry){this.ry=this.rx}else{if(this.ry&&!this.rx){this.rx=this.ry}}},_render:function(f){var j=this.rx||0,i=this.ry||0,d=-this.width/2,k=-this.height/2,e=this.width,g=this.height;f.beginPath();f.globalAlpha*=this.opacity;if(this.group){f.translate(this.x||0,this.y||0)}f.moveTo(d+j,k);f.lineTo(d+e-j,k);f.quadraticCurveTo(d+e,k,d+e,k+i,d+e,k+i);f.lineTo(d+e,k+g-i);f.quadraticCurveTo(d+e,k+g,d+e-j,k+g,d+e-j,k+g);f.lineTo(d+j,k+g);f.quadraticCurveTo(d,k+g,d,k+g-i,d,k+g-i);f.lineTo(d,k+i);f.quadraticCurveTo(d,k,d+j,k,d+j,k);f.closePath();if(this.fill){f.fill()}if(this.stroke){f.stroke()}},_normalizeLeftTopProperties:function(d){if(d.left){this.set("left",d.left+this.getWidth()/2)}this.set("x",d.left||0);if(d.top){this.set("top",d.top+this.getHeight()/2)}this.set("y",d.top||0);return this},complexity:function(){return 1},toObject:function(){return c.util.object.extend(this.callSuper("toObject"),{rx:this.get("rx")||0,ry:this.get("ry")||0})},toSVG:function(){return''}});c.Rect.ATTRIBUTE_NAMES="x y width height rx ry fill fill-opacity opacity stroke stroke-width transform".split(" ");function a(d){d.left=d.left||0;d.top=d.top||0;return d}c.Rect.fromElement=function(e,d){if(!e){return null}var g=c.parseAttributes(e,c.Rect.ATTRIBUTE_NAMES);g=a(g);var f=new c.Rect(c.util.object.extend((d?c.util.object.clone(d):{}),g));f._normalizeLeftTopProperties(g);return f};c.Rect.fromObject=function(d){return new c.Rect(d)}})(typeof exports!="undefined"?exports:this);(function(b){var c=b.fabric||(b.fabric={}),a=c.util.toFixed;if(c.Polyline){c.warn("fabric.Polyline is already defined");return}c.Polyline=c.util.createClass(c.Object,{type:"polyline",initialize:function(e,d){d=d||{};this.set("points",e);this.callSuper("initialize",d);this._calcDimensions()},_calcDimensions:function(){return c.Polygon.prototype._calcDimensions.call(this)},toObject:function(){return c.Polygon.prototype.toObject.call(this)},toSVG:function(){var f=[];for(var e=0,d=this.points.length;e"].join("")},_render:function(f){var e;f.beginPath();f.moveTo(this.points[0].x,this.points[0].y);for(var g=0,d=this.points.length;g"].join("")},_render:function(l){var k;l.beginPath();l.moveTo(this.points[0].x,this.points[0].y);for(var m=0,j=this.points.length;m1){E=Math.sqrt(E);O*=E;N*=E}var R=aa/O;var Q=W/O;var D=(-W)/N;var C=(aa)/N;var H=R*M+Q*L;var q=D*M+C*L;var F=R*T+Q*S;var ab=D*T+C*S;var Z=(F-H)*(F-H)+(ab-q)*(ab-q);var U=1/Z-0.25;if(U<0){U=0}var w=Math.sqrt(U);if(P==J){w=-w}var V=0.5*(H+F)-w*(ab-q);var K=0.5*(q+ab)+w*(F-H);var v=Math.atan2(q-K,H-V);var u=Math.atan2(ab-K,F-V);var Y=u-v;if(Y<0&&P==1){Y+=2*Math.PI}else{if(Y>0&&P==0){Y-=2*Math.PI}}var B=Math.ceil(Math.abs(Y/(Math.PI*0.5+0.001)));var I=[];for(var X=0;X"},toObject:function(){var q=g(this.callSuper("toObject"),{path:this.path});if(this.sourcePath){q.sourcePath=this.sourcePath}if(this.transformMatrix){q.transformMatrix=this.transformMatrix}return q},toDatalessObject:function(){var q=this.toObject();if(this.sourcePath){q.path=this.sourcePath}delete q.sourcePath;return q},toSVG:function(){var t=[];for(var r=0,q=this.path.length;r',"',""].join("")},complexity:function(){return this.path.length},_parsePath:function(){var C=[],z,v,y;for(var u=0,t,q,w=this.path.length;uB){for(var r=1,x=q.length;r"];for(var l=0,j=m.length;l");return k.join("")},toString:function(){return"#"},isSameColor:function(){var j=this.getObjects()[0].get("fill");return this.getObjects().every(function(k){return k.get("fill")===j})},complexity:function(){return this.paths.reduce(function(j,k){return j+((k&&k.complexity)?k.complexity():0)},0)},toGrayscale:function(){var j=this.paths.length;while(j--){this.paths[j].toGrayscale()}return this},getObjects:function(){return this.paths}});function c(m){for(var l=0,j=m.length;l"},getObjects:function(){return this.objects},addWithUpdate:function(h){this._restoreObjectsState();this.objects.push(h);this._calcBounds();this._updateObjectsCoords();return this},removeWithUpdate:function(h){this._restoreObjectsState();f(this.objects,h);h.setActive(false);this._calcBounds();this._updateObjectsCoords();return this},add:function(h){this.objects.push(h);return this},remove:function(h){f(this.objects,h);return this},size:function(){return this.getObjects().length},set:function(h,k){if(typeof k=="function"){this.set(h,k(this[h]))}else{if(h==="fill"||h==="opacity"){var j=this.objects.length;this[h]=k;while(j--){this.objects[j].set(h,k)}}else{this[h]=k}}return this},contains:function(h){return this.objects.indexOf(h)>-1},toObject:function(){return g(this.callSuper("toObject"),{objects:b(this.objects,"clone")})},render:function(j,o){j.save();this.transform(j);var n=Math.max(this.scaleX,this.scaleY);for(var l=0,h=this.objects.length,k;k=this.objects[l];l++){var m=k.borderScaleFactor;k.borderScaleFactor=n;k.render(j);k.borderScaleFactor=m}if(!o&&this.active){this.drawBorders(j);this.hideCorners||this.drawCorners(j)}j.restore();this.setCoords()},item:function(h){return this.getObjects()[h]},complexity:function(){return this.getObjects().reduce(function(i,h){i+=(typeof h.complexity=="function")?h.complexity():0;return i},0)},_restoreObjectsState:function(){this.objects.forEach(this._restoreObjectState,this);return this},_restoreObjectState:function(j){var l=this.get("left"),m=this.get("top"),h=this.getAngle()*(Math.PI/180),k=j.get("originalLeft"),n=j.get("originalTop"),i=Math.cos(h)*j.get("top")+Math.sin(h)*j.get("left"),o=-Math.sin(h)*j.get("top")+Math.cos(h)*j.get("left");j.setAngle(j.getAngle()+this.getAngle());j.set("left",l+o*this.get("scaleX"));j.set("top",m+i*this.get("scaleY"));j.set("scaleX",j.get("scaleX")*this.get("scaleX"));j.set("scaleY",j.get("scaleY")*this.get("scaleY"));j.setCoords();j.hideCorners=false;j.setActive(false);j.setCoords();return this},destroy:function(){return this._restoreObjectsState()},saveCoords:function(){this._originalLeft=this.get("left");this._originalTop=this.get("top");return this},hasMoved:function(){return this._originalLeft!==this.get("left")||this._originalTop!==this.get("top")},setObjectsCoords:function(){this.forEachObject(function(h){h.setCoords()});return this},activateAllObjects:function(){this.forEachObject(function(h){h.setActive()});return this},forEachObject:e.StaticCanvas.prototype.forEachObject,_setOpacityIfSame:function(){var j=this.getObjects(),i=j[0]?j[0].get("opacity"):1;var h=j.every(function(k){return k.get("opacity")===i});if(h){this.opacity=i}},_calcBounds:function(){var s=[],q=[],p,n,k,h,m,l,u,r=0,t=this.objects.length;for(;ri.x&&j-hi.y},toGrayscale:function(){var h=this.objects.length;while(h--){this.objects[h].toGrayscale()}}});e.Group.fromObject=function(h,i){e.util.enlivenObjects(h.objects,function(j){delete h.objects;i&&i(new e.Group(j,h))})};e.Group.async=true})(typeof exports!="undefined"?exports:this);(function(a){var b=fabric.util.object.extend;if(!a.fabric){a.fabric={}}if(a.fabric.Image){fabric.warn("fabric.Image is already defined.");return}if(!fabric.Object){fabric.warn("fabric.Object is required for fabric.Image initialization");return}fabric.Image=fabric.util.createClass(fabric.Object,{active:false,bordervisibility:false,cornervisibility:false,type:"image",initialize:function(d,c){c||(c={});this.callSuper("initialize",c);this._initElement(d);this._originalImage=this.getElement();this._initConfig(c);this.filters=[];if(c.filters){this.filters=c.filters;this.applyFilters()}},getElement:function(){return this._element},setElement:function(c){this._element=c;this._initConfig();return this},getOriginalSize:function(){var c=this.getElement();return{width:c.width,height:c.height}},setBorderVisibility:function(c){this._resetWidthHeight();this._adjustWidthHeightToBorders(showBorder);this.setCoords()},setCornersVisibility:function(c){this.cornervisibility=!!c},render:function(c,d){c.save();if(!d){this.transform(c)}this._render(c);if(this.active&&!d){this.drawBorders(c);this.hideCorners||this.drawCorners(c)}c.restore()},toObject:function(){return b(this.callSuper("toObject"),{src:this._originalImage.src||this._originalImage._src,filters:this.filters.concat()})},toSVG:function(){return''},getSrc:function(){return this.getElement().src||this.getElement()._src},toString:function(){return'#'},clone:function(c){this.constructor.fromObject(this.toObject(),c)},applyFilters:function(i){if(this.filters.length===0){this.setElement(this._originalImage);i&&i();return}var c=typeof Buffer!=="undefined"&&typeof window==="undefined",g=this._originalImage,e=fabric.document.createElement("canvas"),f=c?new (require("canvas").Image):fabric.document.createElement("img"),h=this;if(!e.getContext&&typeof G_vmlCanvasManager!="undefined"){G_vmlCanvasManager.initElement(e)}e.width=g.width;e.height=g.height;e.getContext("2d").drawImage(g,0,0);this.filters.forEach(function(j){j&&j.applyTo(e)});f.onload=function(){h._element=f;i&&i();f.onload=e=g=null};f.width=g.width;f.height=g.height;if(c){var d=e.toDataURL("image/png").replace(/data:image\/png;base64,/,"");f.src=new Buffer(d,"base64");h._element=f;i&&i()}else{f.src=e.toDataURL("image/png")}return this},_render:function(c){c.drawImage(this.getElement(),-this.width/2,-this.height/2,this.width,this.height)},_adjustWidthHeightToBorders:function(c){if(c){this.currentBorder=this.borderwidth;this.width+=(2*this.currentBorder);this.height+=(2*this.currentBorder)}else{this.currentBorder=0}},_resetWidthHeight:function(){var c=this.getElement();this.set("width",c.width);this.set("height",c.height)},_initElement:function(c){this.setElement(fabric.util.getById(c));fabric.util.addClass(this.getElement(),fabric.Image.CSS_CANVAS)},_initConfig:function(c){c||(c={});this.setOptions(c);this._setBorder();this._setWidthHeight(c)},_initFilters:function(c){if(c.filters&&c.filters.length){this.filters=c.filters.map(function(d){return d&&fabric.Image.filters[d.type].fromObject(d)})}},_setBorder:function(){if(this.bordervisibility){this.currentBorder=this.borderwidth}else{this.currentBorder=0}},_setWidthHeight:function(c){var d=2*this.currentBorder;this.width="width" in c?c.width:((this.getElement().width||0)+d);this.height="height" in c?c.height:((this.getElement().height||0)+d)},complexity:function(){return 1}});fabric.Image.CSS_CANVAS="canvas-img";fabric.Image.prototype.getSvgSrc=fabric.Image.prototype.getSrc;fabric.Image.fromObject=function(d,f){var c=fabric.document.createElement("img"),e=d.src;if(d.width){c.width=d.width}if(d.height){c.height=d.height}c.onload=function(){fabric.Image.prototype._initFilters.call(d,d);var g=new fabric.Image(c,d);f&&f(g);c=c.onload=null};c.src=e};fabric.Image.fromURL=function(d,f,e){var c=fabric.document.createElement("img");c.onload=function(){if(f){f(new fabric.Image(c,e))}c=c.onload=null};c.src=d};fabric.Image.ATTRIBUTE_NAMES="x y width height fill fill-opacity opacity stroke stroke-width transform xlink:href".split(" ");fabric.Image.fromElement=function(d,f,c){c||(c={});var e=fabric.parseAttributes(d,fabric.Image.ATTRIBUTE_NAMES);fabric.Image.fromURL(e["xlink:href"],f,b(e,c))};fabric.Image.async=true})(typeof exports!="undefined"?exports:this);fabric.util.object.extend(fabric.Object.prototype,{_getAngleValueForStraighten:function(){var a=this.get("angle");if(a>-225&&a<=-135){return -180}else{if(a>-135&&a<=-45){return -90}else{if(a>-45&&a<=45){return 0}else{if(a>45&&a<=135){return 90}else{if(a>135&&a<=225){return 180}else{if(a>225&&a<=315){return 270}else{if(a>315){return 360}}}}}}}return 0},straighten:function(){var a=this._getAngleValueForStraighten();this.setAngle(a);return this},fxStraighten:function(b){b=b||{};var c=function(){},d=b.onComplete||c,a=b.onChange||c,e=this;fabric.util.animate({startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(f){e.setAngle(f);a()},onComplete:function(){e.setCoords();d()},onStart:function(){e.setActive(false)}});return this}});fabric.util.object.extend(fabric.StaticCanvas.prototype,{straightenObject:function(a){a.straighten();this.renderAll();return this},fxStraightenObject:function(a){a.fxStraighten({onChange:this.renderAll.bind(this)});return this}});fabric.Image.filters={};fabric.Image.filters.Grayscale=fabric.util.createClass({type:"Grayscale",applyTo:function(d){var c=d.getContext("2d"),a=c.getImageData(0,0,d.width,d.height),h=a.data,e=a.width,l=a.height,k,b,g,f;for(g=0;gh&&m>h&&o>h&&p(a-m)'},_render:function(f){if(typeof Cufon==="undefined"||this.useNative===true){this._renderViaNative(f)}else{this._renderViaCufon(f)}},_renderViaCufon:function(f){var h=Cufon.textOptions||(Cufon.textOptions={});h.left=this.left;h.top=this.top;h.context=f;h.color=this.fill;var g=this._initDummyElementForCufon();this.transform(f);Cufon.replaceElement(g,{engine:"canvas",separate:"none",fontFamily:this.fontFamily,fontWeight:this.fontWeight,textDecoration:this.textDecoration,textShadow:this.textShadow,textAlign:this.textAlign,fontStyle:this.fontStyle,lineHeight:this.lineHeight,strokeStyle:this.strokeStyle,strokeWidth:this.strokeWidth,backgroundColor:this.backgroundColor});this.width=h.width;this.height=h.height;this._totalLineHeight=h.totalLineHeight;this._fontAscent=h.fontAscent;this._boundaries=h.boundaries;this._shadowOffsets=h.shadowOffsets;this._shadows=h.shadows||[];this.setCoords()},_renderViaNative:function(f){this.transform(f);this._setTextStyles(f);var g=this.text.split(/\r?\n/);this.width=this._getTextWidth(f,g);this.height=this._getTextHeight(f,g);this._renderTextBackground(f,g);if(this.textAlign!=="left"){f.save();f.translate(this.textAlign==="center"?(this.width/2):this.width,0)}this._setTextShadow(f);this._renderTextFill(f,g);this.textShadow&&f.restore();this._renderTextStroke(f,g);if(this.textAlign!=="left"){f.restore()}this._renderTextDecoration(f,g);this._setBoundaries(f,g);this._totalLineHeight=0;this.setCoords()},_setBoundaries:function(h,k){this._boundaries=[];for(var j=0,g=k.length;jk){k=l}}return k},_setTextShadow:function(f){if(this.textShadow){var j=/\s*(-?\d+)(?:px)?\s+(-?\d+)(?:px)?\s+(\d+)(?:px)?\s*/;var g=this.textShadow;var i=j.exec(this.textShadow);var h=g.replace(j,"");f.save();f.shadowColor=h;f.shadowOffsetX=parseInt(i[0],10);f.shadowOffsetY=parseInt(i[1],10);f.shadowBlur=parseInt(i[2],10);this._shadows=[{blur:f.shadowBlur,color:f.shadowColor,offX:f.shadowOffsetX,offY:f.shadowOffsetY}];this._shadowOffsets=[[parseInt(f.shadowOffsetX,10),parseInt(f.shadowOffsetY,10)]]}},_renderTextFill:function(g,j){this._boundaries=[];for(var h=0,f=j.length;h-1){f.call(this,this.fontSize)}if(this.textDecoration.indexOf("line-through")>-1){f.call(this,this.fontSize/2)}if(this.textDecoration.indexOf("overline")>-1){f.call(this,0)}},_getFontDeclaration:function(){return[this.fontStyle,this.fontWeight,this.fontSize+"px",this.fontFamily].join(" ")},_initDummyElementForCufon:function(){var g=c.document.createElement("pre"),f=c.document.createElement("div");f.appendChild(g);if(typeof G_vmlCanvasManager=="undefined"){g.innerHTML=this.text}else{g.innerText=this.text.replace(/\r?\n/gi,"\r")}g.style.fontSize=this.fontSize+"px";g.style.letterSpacing="normal";return g},render:function(f,g){f.save();this._render(f);if(!g&&this.active){this.drawBorders(f);this.hideCorners||this.drawCorners(f)}f.restore()},toObject:function(){return e(this.callSuper("toObject"),{text:this.text,fontSize:this.fontSize,fontWeight:this.fontWeight,fontFamily:this.fontFamily,fontStyle:this.fontStyle,lineHeight:this.lineHeight,textDecoration:this.textDecoration,textShadow:this.textShadow,textAlign:this.textAlign,path:this.path,strokeStyle:this.strokeStyle,strokeWidth:this.strokeWidth,backgroundColor:this.backgroundColor})},toSVG:function(){var i=this.text.split(/\r?\n/),j=this.useNative?this.fontSize*this.lineHeight:(-this._fontAscent-((this._fontAscent/5)*this.lineHeight)),g=-(this.width/2),f=this.useNative?this.fontSize-1:(this.height/2)-(i.length*this.fontSize)-this._totalLineHeight,h=this._getSVGTextAndBg(j,g,i),k=this._getSVGShadows(j,i);f+=(this._fontAscent?((this._fontAscent/5)*this.lineHeight):0);return['',h.textBgRects.join(""),"',k.join(""),h.textSpans.join(""),"",""].join("")},_getSVGShadows:function(h,n){var o=[],k,l,p,g,f=1;if(!this._shadows||!this._boundaries){return o}for(k=0,p=this._shadows.length;k",c.util.string.escapeXml(n[l]),"");f=1}else{f++}}}return o},_getSVGTextAndBg:function(j,h,n){var g=[],k=[],l,m,o,f=1;for(l=0,o=n.length;l",c.util.string.escapeXml(n[l]),"");f=1}else{f++}if(!this.backgroundColor||!this._boundaries){continue}k.push("')}return{textSpans:g,textBgRects:k}},_getFillAttributes:function(f){var g=f?new c.Color(f):"";if(!g||!g.getSource()||g.getAlpha()===1){return'fill="'+f+'"'}return'opacity="'+g.getAlpha()+'" fill="'+g.setAlpha(1).toRgb()+'"'},setColor:function(f){this.set("fill",f);return this},setFontsize:function(f){this.set("fontSize",f);this.setCoords();return this},getText:function(){return this.text},setText:function(f){this.set("text",f);this.setCoords();return this},set:function(f,g){if(typeof f=="object"){for(var h in f){this.set(h,f[h])}}else{this[f]=g;if(f==="fontFamily"&&this.path){this.path=this.path.replace(/(.*?)([^\/]*)(\.font\.js)/,"$1"+g+"$3")}}return this}});c.Text.fromObject=function(f){return new c.Text(f.text,d(f))};c.Text.fromElement=function(f){}})(typeof exports!="undefined"?exports:this);(function(){if(typeof document!="undefined"&&typeof window!="undefined"){return}var DOMParser=new require("xmldom").DOMParser,URL=require("url"),HTTP=require("http"),Canvas=require("canvas"),Image=require("canvas").Image;function request(url,encoding,callback){var oURL=URL.parse(url),client=HTTP.createClient(oURL.port,oURL.hostname),request=client.request("GET",oURL.pathname,{host:oURL.hostname});client.addListener("error",function(err){if(err.errno===process.ECONNREFUSED){fabric.log("ECONNREFUSED: connection refused to "+client.host+":"+client.port)}else{fabric.log(err.message)}});request.end();request.on("response",function(response){var body="";if(encoding){response.setEncoding(encoding)}response.on("end",function(){callback(body)});response.on("data",function(chunk){if(response.statusCode==200){body+=chunk}})})}fabric.util.loadImage=function(url,callback){request(url,"binary",function(body){var img=new Image();img.src=new Buffer(body,"binary");img._src=url;callback(img)})};fabric.loadSVGFromURL=function(url,callback){url=url.replace(/^\n\s*/,"").replace(/\?.*$/,"").trim();request(url,"",function(body){var doc=new DOMParser().parseFromString(body);fabric.parseSVGDocument(doc.documentElement,function(results,options){callback(results,options)})})};fabric.util.getScript=function(url,callback){request(url,"",function(body){eval(body);callback&&callback()})};fabric.Image.fromObject=function(object,callback){fabric.util.loadImage(object.src,function(img){var oImg=new fabric.Image(img);oImg._initConfig(object);oImg._initFilters(object);callback(oImg)})};fabric.createCanvasForNode=function(width,height){var canvasEl=fabric.document.createElement("canvas"),nodeCanvas=new Canvas(width||600,height||600);canvasEl.style={};canvasEl.width=nodeCanvas.width;canvasEl.height=nodeCanvas.height;var canvas=fabric.Canvas||fabric.StaticCanvas;var fabricCanvas=new canvas(canvasEl);fabricCanvas.contextContainer=nodeCanvas.getContext("2d");fabricCanvas.nodeCanvas=nodeCanvas;return fabricCanvas};fabric.StaticCanvas.prototype.createPNGStream=function(){return this.nodeCanvas.createPNGStream()};if(fabric.Canvas){fabric.Canvas.prototype.createPNGStream}var origSetWidth=fabric.StaticCanvas.prototype.setWidth;fabric.StaticCanvas.prototype.setWidth=function(width){origSetWidth.call(this);this.nodeCanvas.width=width;return this};if(fabric.Canvas){fabric.Canvas.prototype.setWidth=fabric.StaticCanvas.prototype.setWidth}var origSetHeight=fabric.StaticCanvas.prototype.setHeight;fabric.StaticCanvas.prototype.setHeight=function(height){origSetHeight.call(this);this.nodeCanvas.height=height;return this};if(fabric.Canvas){fabric.Canvas.prototype.setHeight=fabric.StaticCanvas.prototype.setHeight}})(); \ No newline at end of file +var Cufon=(function(){var k=function(){return k.replace.apply(null,arguments)};var u=k.DOM={ready:(function(){var z=false,B={loaded:1,complete:1};var y=[],A=function(){if(z){return}z=true;for(var C;C=y.shift();C()){}};if(fabric.document.addEventListener){fabric.document.addEventListener("DOMContentLoaded",A,false);fabric.window.addEventListener("pageshow",A,false)}if(!fabric.window.opera&&fabric.document.readyState){(function(){B[fabric.document.readyState]?A():setTimeout(arguments.callee,10)})()}if(fabric.document.readyState&&fabric.document.createStyleSheet){(function(){try{fabric.document.body.doScroll("left");A()}catch(C){setTimeout(arguments.callee,1)}})()}o(fabric.window,"load",A);return function(C){if(!arguments.length){A()}else{z?C():y.push(C)}}})()};var l=k.CSS={Size:function(z,y){this.value=parseFloat(z);this.unit=String(z).match(/[a-z%]*$/)[0]||"px";this.convert=function(A){return A/y*this.value};this.convertFrom=function(A){return A/this.value*y};this.toString=function(){return this.value+this.unit}},getStyle:function(y){return new a(y.style)},quotedList:i(function(B){var A=[],z=/\s*((["'])([\s\S]*?[^\\])\2|[^,]+)\s*/g,y;while(y=z.exec(B)){A.push(y[3]||y[1])}return A}),ready:(function(){var A=false;var z=[],B=function(){A=true;for(var D;D=z.shift();D()){}};var y=Object.prototype.propertyIsEnumerable?f("style"):{length:0};var C=f("link");u.ready(function(){var G=0,F;for(var E=0,D=C.length;F=C[E],E=y.length+G){B()}else{setTimeout(arguments.callee,10)}});return function(D){if(A){D()}else{z.push(D)}}})(),supports:function(A,z){var y=fabric.document.createElement("span").style;if(y[A]===undefined){return false}y[A]=z;return y[A]===z},textAlign:function(B,A,y,z){if(A.get("textAlign")=="right"){if(y>0){B=" "+B}}else{if(y400}if(F==500){F=400}for(var G in D){G=parseInt(G,10);if(!C||GA){A=G}H.push(G)}if(FA){F=A}H.sort(function(J,I){return(B?(J>F&&I>F)?JI:(JI:Jz){z=e}L.push(e);e=0;continue}var B=ab.glyphs[ag[aa]]||ab.missingGlyph;if(!B){continue}e+=D=Number(B.w||ab.w)+U}L.push(e);e=Math.max(z,e);var m=[];for(var aa=L.length;aa--;){m[aa]=e-L[aa]}if(D===null){return null}V+=(H.width-D);C+=H.minX;var v,p;if(n){v=J;p=J.firstChild}else{v=fabric.document.createElement("span");v.className="cufon cufon-canvas";v.alt=E;p=fabric.document.createElement("canvas");v.appendChild(p);if(A.printable){var Y=fabric.document.createElement("span");Y.className="cufon-alt";Y.appendChild(fabric.document.createTextNode(E));v.appendChild(Y)}}var ah=v.style;var O=p.style||{};var k=o.convert(H.height-I+T);var af=Math.ceil(k);var S=af/k;p.width=Math.ceil(o.convert(e+V-C)*S);p.height=af;I+=H.minY;O.top=Math.round(o.convert(I-ab.ascent))+"px";O.left=Math.round(o.convert(C))+"px";var j=Math.ceil(o.convert(e*S));var t=j+"px";var s=o.convert(ab.height);var F=(A.lineHeight-1)*o.convert(-ab.ascent/5)*(M-1);Cufon.textOptions.width=j;Cufon.textOptions.height=(s*M)+F;Cufon.textOptions.lines=M;Cufon.textOptions.totalLineHeight=F;if(a){ah.width=t;ah.height=s+"px"}else{ah.paddingLeft=t;ah.paddingBottom=(s-1)+"px"}var ad=Cufon.textOptions.context||p.getContext("2d"),K=af/H.height;Cufon.textOptions.fontAscent=ab.ascent*K;Cufon.textOptions.boundaries=null;for(var w=Cufon.textOptions.shadowOffsets,aa=R.length;aa--;){w[aa]=[R[aa][0]*K,R[aa][1]*K]}ad.save();ad.scale(K,K);ad.translate(-C-((1/K*p.width)/2)+(Cufon.fonts[ab.family].offsetLeft||0),-I-((Cufon.textOptions.height/K)/2)+(Cufon.fonts[ab.family].offsetTop||0));ad.lineWidth=ab.face["underline-thickness"];ad.save();function q(l,i){ad.strokeStyle=i;ad.beginPath();ad.moveTo(0,l);ad.lineTo(e,l);ad.stroke()}var r=Cufon.getTextDecoration(A),u=A.fontStyle==="italic";function ae(){ad.save();ad.fillStyle=A.backgroundColor;var aj=0,an=0,y=[{left:0}];if(A.textAlign==="right"){ad.translate(m[an],0);y[0].left=m[an]*K}else{if(A.textAlign==="center"){ad.translate(m[an]/2,0);y[0].left=m[an]/2*K}}for(var al=0,ak=ag.length;al.cufon-vml-canvas{text-indent:0}@media screen{cvml\\:shape,cvml\\:shadow{behavior:url(#default#VML);display:block;antialias:true;position:absolute}.cufon-vml-canvas{position:absolute;text-align:left}.cufon-vml{display:inline-block;position:relative;vertical-align:middle}.cufon-vml .cufon-alt{position:absolute;left:-10000in;font-size:1px}a .cufon-vml{cursor:pointer}}@media print{.cufon-vml *{display:none}.cufon-vml .cufon-alt{display:inline}}');function c(e,f){return a(e,/(?:em|ex|%)$/i.test(f)?"1em":f)}function a(h,i){if(/px$/i.test(i)){return parseFloat(i)}var g=h.style.left,f=h.runtimeStyle.left;h.runtimeStyle.left=h.currentStyle.left;h.style.left=i;var e=h.style.pixelLeft;h.style.left=g;h.runtimeStyle.left=f;return e}return function(T,z,O,w,D,U,M){var h=(z===null);if(h){z=D.alt}var B=T.viewBox;var j=O.computedFontSize||(O.computedFontSize=new Cufon.CSS.Size(c(U,O.get("fontSize"))+"px",T.baseSize));var L=O.computedLSpacing;if(L==undefined){L=O.get("letterSpacing");O.computedLSpacing=L=(L=="normal")?0:~~j.convertFrom(a(U,L))}var t,m;if(h){t=D;m=D.firstChild}else{t=fabric.document.createElement("span");t.className="cufon cufon-vml";t.alt=z;m=fabric.document.createElement("span");m.className="cufon-vml-canvas";t.appendChild(m);if(w.printable){var R=fabric.document.createElement("span");R.className="cufon-alt";R.appendChild(fabric.document.createTextNode(z));t.appendChild(R)}if(!M){t.appendChild(fabric.document.createElement("cvml:shape"))}}var Z=t.style;var G=m.style;var f=j.convert(B.height),W=Math.ceil(f);var K=W/f;var J=B.minX,I=B.minY;G.height=W;G.top=Math.round(j.convert(I-T.ascent));G.left=Math.round(j.convert(J));Z.height=j.convert(T.height)+"px";var p=Cufon.getTextDecoration(w);var y=O.get("color");var X=Cufon.CSS.textTransform(z,O).split("");var e=0,H=0,q=null;var x,r,A=w.textShadow;for(var S=0,Q=0,P=X.length;Sw?p:(o-n);s(t(currentTime,m,byValue,p));if(o>w||q()){x.onComplete&&x.onComplete();return}k(r)})()}var f=fabric.window.requestAnimationFrame||fabric.window.webkitRequestAnimationFrame||fabric.window.mozRequestAnimationFrame||fabric.window.oRequestAnimationFrame||fabric.window.msRequestAnimationFrame||function(n,m){fabric.window.setTimeout(n,1000/60)};var k=function(){return f.apply(fabric.window,arguments)};function b(n,p,o){if(n){var m=new Image();m.onload=function(){p&&p.call(o,m);m=m.onload=null};m.src=n}else{p&&p.call(o,n)}}function i(o,s){function n(t){return fabric[fabric.util.string.camelize(fabric.util.string.capitalize(t))]}var q=[],p=0,m=o.filter(function(t){return n(t.type).async}).length;var r=this;o.forEach(function(v,u){if(!v.type){return}var t=n(v.type);if(t.async){t.fromObject(v,function(w){q[u]=w;if(++p===m){if(s){s(q)}}})}else{q[u]=t.fromObject(v)}});if(m===0&&s){s(q)}}function a(o,n,p){var m=o.length>1?new fabric.PathGroup(o,n):o[0];if(typeof p!=="undefined"){m.setSourcePath(p)}return m}fabric.util.removeFromArray=j;fabric.util.degreesToRadians=c;fabric.util.toFixed=e;fabric.util.getRandomInt=g;fabric.util.falseFunction=l;fabric.util.animate=d;fabric.util.requestAnimFrame=k;fabric.util.loadImage=b;fabric.util.enlivenObjects=i;fabric.util.groupSVGElements=a})();(function(){var d=Array.prototype.slice;if(!Array.prototype.indexOf){Array.prototype.indexOf=function(g){if(this===void 0||this===null){throw new TypeError()}var h=Object(this),e=h.length>>>0;if(e===0){return -1}var i=0;if(arguments.length>0){i=Number(arguments[1]);if(i!==i){i=0}else{if(i!==0&&i!==(1/0)&&i!==-(1/0)){i=(i>0||-1)*Math.floor(Math.abs(i))}}}if(i>=e){return -1}var f=i>=0?i:Math.max(e-Math.abs(i),0);for(;f>>0;f>>0;g>>0;f>>0;f>>0;g>>0,f=0,h;if(arguments.length>1){h=arguments[1]}else{do{if(f in this){h=this[f++];break}if(++f>=e){throw new TypeError()}}while(true)}for(;f=e){e=h[f][g]}}}else{while(f--){if(h[f]>=e){e=h[f]}}}return e}function c(h,g){if(!h||h.length===0){return undefined}var f=h.length-1,e=g?h[f][g]:h[f];if(g){while(f--){if(h[f][g]/g,">")}fabric.util.string={camelize:b,capitalize:c,escapeXml:a}}());(function(){var c=Array.prototype.slice,a=Function.prototype.apply,b=function(){};if(!Function.prototype.bind){Function.prototype.bind=function(d){var g=this,e=c.call(arguments,1),f;if(e.length){f=function(){return a.call(g,this instanceof b?this:d,e.concat(c.call(arguments)))}}else{f=function(){return a.call(g,this instanceof b?this:d,arguments)}}b.prototype=this.prototype;f.prototype=new b;return f}}})();(function(){var f=Array.prototype.slice,e=function(){};var c=(function(){for(var g in {toString:1}){if(g==="toString"){return false}}return true})();var b=function(g,j,h){for(var i in j){if(i in g.prototype&&typeof g.prototype[i]=="function"){g.prototype[i]=(function(k){return function(){var m=this.constructor.superclass;this.constructor.superclass=h;var l=j[k].apply(this,arguments);this.constructor.superclass=m;if(k!=="initialize"){return l}}})(i)}else{g.prototype[i]=j[i]}if(c){if(j.toString!==Object.prototype.toString){g.prototype.toString=j.toString}if(j.valueOf!==Object.prototype.valueOf){g.prototype.valueOf=j.valueOf}}}};function a(){}function d(){var k=null,j=f.call(arguments,0);if(typeof j[0]==="function"){k=j.shift()}function g(){this.initialize.apply(this,arguments)}g.superclass=k;g.subclasses=[];if(k){a.prototype=k.prototype;g.prototype=new a;k.subclasses.push(g)}for(var h=0,l=j.length;h-1?c(j,l.match(/opacity:\s*(\d?\.?\d*)/)[1]):j}for(var m in l){if(m==="opacity"){c(j,l[m])}else{var k=(m==="float"||m==="cssFloat")?(typeof n.styleFloat==="undefined"?"cssFloat":"styleFloat"):m;n[k]=l[m]}}return j}var h=fabric.document.createElement("div"),g=typeof h.style.opacity==="string",b=typeof h.style.filter==="string",a=fabric.document.defaultView,f=a&&typeof a.getComputedStyle!=="undefined",d=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,c=function(i){return i};if(g){c=function(i,j){i.style.opacity=j;return i}}else{if(b){c=function(i,j){var k=i.style;if(i.currentStyle&&!i.currentStyle.hasLayout){k.zoom=1}if(d.test(k.filter)){j=j>=0.9999?"":("alpha(opacity="+(j*100)+")");k.filter=k.filter.replace(d,j)}else{k.filter+=" alpha(opacity="+(j*100)+")"}return i}}}fabric.util.setStyle=e})();(function(){var h=Array.prototype.slice;function g(j){return typeof j==="string"?fabric.document.getElementById(j):j}function b(j){return h.call(j,0)}try{var i=b(fabric.document.childNodes) instanceof Array}catch(a){}if(!i){b=function(k){var j=new Array(k.length),l=k.length;while(l--){j[l]=k[l]}return j}}function c(k,j){var l=fabric.document.createElement(k);for(var m in j){if(m==="class"){l.className=j[m]}else{if(m==="for"){l.htmlFor=j[m]}else{l.setAttribute(m,j[m])}}}return l}function f(j,k){if((" "+j.className+" ").indexOf(" "+k+" ")===-1){j.className+=(j.className?" ":"")+k}}function e(k,l,j){if(typeof l==="string"){l=c(l,j)}if(k.parentNode){k.parentNode.replaceChild(l,k)}l.appendChild(k);return l}function d(k){var j=0,l=0;do{j+=k.offsetTop||0;l+=k.offsetLeft||0;k=k.offsetParent}while(k);return({left:l,top:j})}(function(){var k=fabric.document.documentElement.style;var l="userSelect" in k?"userSelect":"MozUserSelect" in k?"MozUserSelect":"WebkitUserSelect" in k?"WebkitUserSelect":"KhtmlUserSelect" in k?"KhtmlUserSelect":"";function m(n){if(typeof n.onselectstart!=="undefined"){n.onselectstart=fabric.util.falseFunction}if(l){n.style[l]="none"}else{if(typeof n.unselectable=="string"){n.unselectable="on"}}return n}function j(n){if(typeof n.onselectstart!=="undefined"){n.onselectstart=null}if(l){n.style[l]=""}else{if(typeof n.unselectable=="string"){n.unselectable=""}}return n}fabric.util.makeElementUnselectable=m;fabric.util.makeElementSelectable=j})();(function(){function j(k,o){var m=fabric.document.getElementsByTagName("head")[0],l=fabric.document.createElement("script"),n=true;l.type="text/javascript";l.setAttribute("runat","server");l.onload=l.onreadystatechange=function(p){if(n){if(typeof this.readyState=="string"&&this.readyState!=="loaded"&&this.readyState!=="complete"){return}n=false;o(p||fabric.window.event);l=l.onload=l.onreadystatechange=null}};l.src=k;m.appendChild(l)}fabric.util.getScript=j})();fabric.util.getById=g;fabric.util.toArray=b;fabric.util.makeElement=c;fabric.util.addClass=f;fabric.util.wrapElement=e;fabric.util.getElementOffset=d})();(function(){function d(e,f){return e+(/\?/.test(e)?"&":"?")+f}var c=(function(){var h=[function(){return new ActiveXObject("Microsoft.XMLHTTP")},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml2.XMLHTTP.3.0")},function(){return new XMLHttpRequest()}];for(var e=h.length;e--;){try{var g=h[e]();if(g){return h[e]}}catch(f){}}})();function a(){}function b(g,f){f||(f={});var j=f.method?f.method.toUpperCase():"GET",i=f.onComplete||function(){},h=c(),e;h.onreadystatechange=function(){if(h.readyState===4){i(h);h.onreadystatechange=a}};if(j==="GET"){e=null;if(typeof f.parameters=="string"){g=d(g,f.parameters)}}h.open(j,g,true);if(j==="POST"||j==="PUT"){h.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}h.send(e);return h}fabric.util.request=b})();(function(){function d(F,E,H,G){return H*(F/=G)*F+E}function l(F,E,H,G){return -H*(F/=G)*(F-2)+E}function r(F,E,H,G){if((F/=G/2)<1){return H/2*F*F+E}return -H/2*((--F)*(F-2)-1)+E}function B(F,E,H,G){return H*(F/=G)*F*F+E}function q(F,E,H,G){return H*((F=F/G-1)*F*F+1)+E}function u(F,E,H,G){if((F/=G/2)<1){return H/2*F*F*F+E}return H/2*((F-=2)*F*F+2)+E}function t(F,E,H,G){return H*(F/=G)*F*F*F+E}function g(F,E,H,G){return -H*((F=F/G-1)*F*F*F-1)+E}function k(F,E,H,G){if((F/=G/2)<1){return H/2*F*F*F*F+E}return -H/2*((F-=2)*F*F*F-2)+E}function y(F,E,H,G){return H*(F/=G)*F*F*F*F+E}function j(F,E,H,G){return H*((F=F/G-1)*F*F*F*F+1)+E}function n(F,E,H,G){if((F/=G/2)<1){return H/2*F*F*F*F*F+E}return H/2*((F-=2)*F*F*F*F+2)+E}function f(F,E,H,G){return -H*Math.cos(F/G*(Math.PI/2))+H+E}function o(F,E,H,G){return H*Math.sin(F/G*(Math.PI/2))+E}function v(F,E,H,G){return -H/2*(Math.cos(Math.PI*F/G)-1)+E}function D(F,E,H,G){return(F==0)?E:H*Math.pow(2,10*(F/G-1))+E}function c(F,E,H,G){return(F==G)?E+H:H*(-Math.pow(2,-10*F/G)+1)+E}function i(F,E,H,G){if(F==0){return E}if(F==G){return E+H}if((F/=G/2)<1){return H/2*Math.pow(2,10*(F-1))+E}return H/2*(-Math.pow(2,-10*--F)+2)+E}function h(F,E,H,G){return -H*(Math.sqrt(1-(F/=G)*F)-1)+E}function p(F,E,H,G){return H*Math.sqrt(1-(F=F/G-1)*F)+E}function x(F,E,H,G){if((F/=G/2)<1){return -H/2*(Math.sqrt(1-F*F)-1)+E}return H/2*(Math.sqrt(1-(F-=2)*F)+1)+E}function s(G,E,K,J){var H=1.70158;var I=0;var F=K;if(G==0){return E}if((G/=J)==1){return E+K}if(!I){I=J*0.3}if(F-1;w=w.split(/\s+/);var u=[];if(y){for(var v=0,t=w.length;v/i,""))}if(!w.documentElement){return}h.parseSVGDocument(w.documentElement,function(z,y){k.set(t,{objects:h.util.array.invoke(z,"toObject"),options:y});v(z,y)})}}function b(v){var u=v.objects,t=v.options;u=u.map(function(w){return h[f(w.type)].fromObject(w)});return({objects:u,options:t})}function n(t,w){t=t.trim();var u;if(typeof DOMParser!=="undefined"){var v=new DOMParser();if(v&&v.parseFromString){u=v.parseFromString(t,"text/xml")}}else{if(h.window.ActiveXObject){var u=new ActiveXObject("Microsoft.XMLDOM");u.async="false";u.loadXML(t.replace(//i,""))}}h.parseSVGDocument(u.documentElement,function(y,x){w(y,x)})}function m(w){var u="";for(var v=0,t=w.length;v",'",""].join("")}return u}p(h,{parseAttributes:e,parseElements:g,parseStyleAttribute:i,parsePointsAttribute:s,getCSSRules:d,loadSVGFromURL:c,loadSVGFromString:n,createSVGFontFacesMarkup:m})})(typeof exports!="undefined"?exports:this);(function(){function c(h){var g=h.getAttribute("style");if(g){var k=g.split(/\s*;\s*/);if(k[k.length-1]===""){k.pop()}for(var f=k.length;f--;){var e=k[f].split(/\s*:\s*/),d=e[0].trim(),j=e[1].trim();if(d==="stop-color"){return j}}}}fabric.Gradient={create:function(l,m){m||(m={});var f=m.x1||0,k=m.y1||0,e=m.x2||l.canvas.width,i=m.y2||0,g=m.colorStops;var j=l.createLinearGradient(f,k,e,i);for(var h in g){var d=g[h];j.addColorStop(parseFloat(h),d)}return j},fromElement:function(d,m,l){var j=d.getElementsByTagName("stop"),d,f,e={},g,k={x1:d.getAttribute("x1")||0,y1:d.getAttribute("y1")||0,x2:d.getAttribute("x2")||"100%",y2:d.getAttribute("y2")||0};for(var h=j.length;h--;){d=j[h];f=d.getAttribute("offset");f=parseFloat(f)/(/%$/.test(f)?100:1);e[f]=c(d)||d.getAttribute("stop-color")}a(l,k);return fabric.Gradient.create(m,{x1:k.x1,y1:k.y1,x2:k.x2,y2:k.y2,colorStops:e})},forObject:function(g,d,e){e||(e={});a(g,e);var f=fabric.Gradient.create(d,{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,colorStops:e.colorStops});return f}};function a(f,e){for(var g in e){if(typeof e[g]==="string"&&/^\d+%$/.test(e[g])){var d=parseFloat(e[g],10);if(g==="x1"||g==="x2"){e[g]=f.width*d/100}else{if(g==="y1"||g==="y2"){e[g]=f.height*d/100}}}if(g==="x1"||g==="x2"){e[g]-=f.width/2}else{if(g==="y1"||g==="y2"){e[g]-=f.height/2}}}}function b(j){var f=j.getElementsByTagName("linearGradient"),d=j.getElementsByTagName("radialGradient"),g,h={};for(var e=f.length;e--;){g=f[e];h[g.id]=g}for(var e=d.length;e--;){g=d[e];h[g.id]=g}return h}fabric.getGradientDefs=b})();(function(b){var c=b.fabric||(b.fabric={});if(c.Point){c.warn("fabric.Point is already defined");return}c.Point=a;function a(d,e){if(arguments.length>0){this.init(d,e)}}a.prototype={constructor:a,init:function(d,e){this.x=d;this.y=e},add:function(d){return new a(this.x+d.x,this.y+d.y)},addEquals:function(d){this.x+=d.x;this.y+=d.y;return this},scalarAdd:function(d){return new a(this.x+d,this.y+d)},scalarAddEquals:function(d){this.x+=d;this.y+=d;return this},subtract:function(d){return new a(this.x-d.x,this.y-d.y)},subtractEquals:function(d){this.x-=d.x;this.y-=d.y;return this},scalarSubtract:function(d){return new a(this.x-d,this.y-d)},scalarSubtractEquals:function(d){this.x-=d;this.y-=d;return this},multiply:function(d){return new a(this.x*d,this.y*d)},multiplyEquals:function(d){this.x*=d;this.y*=d;return this},divide:function(d){return new a(this.x/d,this.y/d)},divideEquals:function(d){this.x/=d;this.y/=d;return this},eq:function(d){return(this.x==d.x&&this.y==d.y)},lt:function(d){return(this.xd.x&&this.y>d.y)},gte:function(d){return(this.x>=d.x&&this.y>=d.y)},lerp:function(e,d){return new a(this.x+(e.x-this.x)*d,this.y+(e.y-this.y)*d)},distanceFrom:function(f){var e=this.x-f.x,d=this.y-f.y;return Math.sqrt(e*e+d*d)},min:function(d){return new a(Math.min(this.x,d.x),Math.min(this.y,d.y))},max:function(d){return new a(Math.max(this.x,d.x),Math.max(this.y,d.y))},toString:function(){return this.x+","+this.y},setXY:function(d,e){this.x=d;this.y=e},setFromPoint:function(d){this.x=d.x;this.y=d.y},swap:function(e){var d=this.x,f=this.y;this.x=e.x;this.y=e.y;e.x=d;e.y=f}}})(typeof exports!="undefined"?exports:this);(function(a){var b=a.fabric||(a.fabric={});if(b.Intersection){b.warn("fabric.Intersection is already defined");return}function c(d){if(arguments.length>0){this.init(d)}}b.Intersection=c;b.Intersection.prototype={init:function(d){this.status=d;this.points=[]},appendPoint:function(d){this.points.push(d)},appendPoints:function(d){this.points=this.points.concat(d)}};b.Intersection.intersectLineLine=function(h,f,l,k){var m,i=(k.x-l.x)*(h.y-l.y)-(k.y-l.y)*(h.x-l.x),j=(f.x-h.x)*(h.y-l.y)-(f.y-h.y)*(h.x-l.x),g=(k.y-l.y)*(f.x-h.x)-(k.x-l.x)*(f.y-h.y);if(g!=0){var e=i/g,d=j/g;if(0<=e&&e<=1&&0<=d&&d<=1){m=new c("Intersection");m.points.push(new b.Point(h.x+e*(f.x-h.x),h.y+e*(f.y-h.y)))}else{m=new c("No Intersection")}}else{if(i==0||j==0){m=new c("Coincident")}else{m=new c("Parallel")}}return m};b.Intersection.intersectLinePolygon=function(e,d,l){var m=new c("No Intersection"),f=l.length;for(var h=0;h0){m.status="Intersection"}return m};b.Intersection.intersectPolygonPolygon=function(j,h){var f=new c("No Intersection"),l=j.length;for(var k=0;k0){f.status="Intersection"}return f};b.Intersection.intersectPolygonRectangle=function(n,e,d){var g=e.min(d),m=e.max(d),f=new b.Point(m.x,g.y),l=new b.Point(g.x,m.y),k=c.intersectLinePolygon(g,f,n),j=c.intersectLinePolygon(f,m,n),i=c.intersectLinePolygon(m,l,n),h=c.intersectLinePolygon(l,g,n),o=new c("No Intersection");o.appendPoints(k.points);o.appendPoints(j.points);o.appendPoints(i.points);o.appendPoints(h.points);if(o.points.length>0){o.status="Intersection"}return o}})(typeof exports!="undefined"?exports:this);(function(a){var b=a.fabric||(a.fabric={});if(b.Color){b.warn("fabric.Color is already defined.");return}function c(d){if(!d){this.setSource([0,0,0,1])}else{this._tryParsingColor(d)}}b.Color=c;b.Color.prototype={_tryParsingColor:function(d){var e=c.sourceFromHex(d);if(!e){e=c.sourceFromRgb(d)}if(e){this.setSource(e)}},getSource:function(){return this._source},setSource:function(d){this._source=d},toRgb:function(){var d=this.getSource();return"rgb("+d[0]+","+d[1]+","+d[2]+")"},toRgba:function(){var d=this.getSource();return"rgba("+d[0]+","+d[1]+","+d[2]+","+d[3]+")"},toHex:function(){var h=this.getSource();var f=h[0].toString(16);f=(f.length==1)?("0"+f):f;var e=h[1].toString(16);e=(e.length==1)?("0"+e):e;var d=h[2].toString(16);d=(d.length==1)?("0"+d):d;return f.toUpperCase()+e.toUpperCase()+d.toUpperCase()},getAlpha:function(){return this.getSource()[3]},setAlpha:function(e){var d=this.getSource();d[3]=e;this.setSource(d);return this},toGrayscale:function(){var f=this.getSource(),e=parseInt((f[0]*0.3+f[1]*0.59+f[2]*0.11).toFixed(0),10),d=f[3];this.setSource([e,e,e,d]);return this},toBlackWhite:function(d){var g=this.getSource(),f=(g[0]*0.3+g[1]*0.59+g[2]*0.11).toFixed(0),e=g[3],d=d||127;f=(Number(f)','',"',"Created with Fabric.js ",fabric.version,"",fabric.createSVGFontFacesMarkup(this.getObjects())];if(this.backgroundImage){h.push('')}for(var j=0,k=this.getObjects(),g=k.length;j");return h.join("")},isEmpty:function(){return this._objects.length===0},remove:function(g){e(this._objects,g);if(this.getActiveObject()===g){this.fire("before:selection:cleared",{target:g});this.discardActiveObject();this.fire("selection:cleared")}this.renderAll();return g},sendToBack:function(g){e(this._objects,g);this._objects.unshift(g);return this.renderAll()},bringToFront:function(g){e(this._objects,g);this._objects.push(g);return this.renderAll()},sendBackwards:function(j){var h=this._objects.indexOf(j),g=h;if(h!==0){for(var k=h-1;k>=0;--k){if(j.intersectsWithObject(this._objects[k])||j.isContainedWithinObject(this._objects[k])){g=k;break}}e(this._objects,j);this._objects.splice(g,0,j)}return this.renderAll()},bringForward:function(k){var n=this.getObjects(),h=n.indexOf(k),g=h;if(h!==n.length-1){for(var m=h+1,j=this._objects.length;m"};f(fabric.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',toGrayscale:function(l){var k=l.getContext("2d"),g=k.getImageData(0,0,l.width,l.height),p=g.data,m=g.width,r=g.height,q,h,o,n;for(o=0;o0)?0:-v),r.ey-((u>0)?0:-u),t,s);this.contextTop.lineWidth=this.selectionLineWidth;this.contextTop.strokeStyle=this.selectionBorderColor;this.contextTop.strokeRect(r.ex+a-((v>0)?0:t),r.ey+a-((u>0)?0:s),t,s)},_findSelectedObjects:function(x){var y,t,D=[],s=this._groupSelector.ex,C=this._groupSelector.ey,r=s+this._groupSelector.left,A=C+this._groupSelector.top,z,w=new fabric.Point(f(s,r),f(C,A)),B=new fabric.Point(l(s,r),l(C,A));for(var u=0,v=this._objects.length;u1){var D=new fabric.Group(D);this.setActiveGroup(D);D.saveCoords();this.fire("selection:created",{target:D})}}this.renderAll()},findTarget:function(v,s){var u,w=this.getPointer(v);var t=this.getActiveGroup();if(t&&!s&&this.containsPoint(v,t)){u=t;return u}for(var r=this._objects.length;r--;){if(this._objects[r]&&this.containsPoint(v,this._objects[r])){u=this._objects[r];this.relatedTarget=u;break}}if(u&&u.selectable){return u}},getPointer:function(r){var s=q(r);return{x:s.x-this._offset.left,y:s.y-this._offset.top}},_createUpperCanvas:function(){this.upperCanvasEl=this._createCanvasElement();this.upperCanvasEl.className="upper-canvas";this.wrapperEl.appendChild(this.upperCanvasEl);this._applyCanvasStyle(this.upperCanvasEl);this.contextTop=this.upperCanvasEl.getContext("2d")},_initWrapperElement:function(){this.wrapperEl=fabric.util.wrapElement(this.lowerCanvasEl,"div",{"class":this.containerClass});fabric.util.setStyle(this.wrapperEl,{width:this.getWidth()+"px",height:this.getHeight()+"px",position:"relative"});fabric.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(s){var t=this.getWidth()||s.width,r=this.getHeight()||s.height;fabric.util.setStyle(s,{position:"absolute",width:t+"px",height:r+"px",left:0,top:0});s.width=t;s.height=r;fabric.util.makeElementUnselectable(s)},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},setActiveObject:function(r,s){if(this._activeObject){this._activeObject.setActive(false)}this._activeObject=r;r.setActive(true);this.renderAll();this.fire("object:selected",{target:r,e:s});r.fire("selected",{e:s});return this},getActiveObject:function(){return this._activeObject},discardActiveObject:function(){if(this._activeObject){this._activeObject.setActive(false)}this._activeObject=null;return this},setActiveGroup:function(r){this._activeGroup=r;r&&r.setActive(true);return this},getActiveGroup:function(){return this._activeGroup},discardActiveGroup:function(){var r=this.getActiveGroup();if(r){r.destroy()}return this.setActiveGroup(null)},deactivateAll:function(){var s=this.getObjects(),t=0,r=s.length;for(;t1)?q.apply(this,o.call(arguments,1)):q.call(this)},initialize:function(i){i&&this.setOptions(i)},setOptions:function(q){var r=this.stateProperties.length,s;while(r--){s=this.stateProperties[r];if(s in q){this.set(s,q[s])}}},transform:function(i){i.globalAlpha=this.opacity;i.translate(this.left,this.top);i.rotate(this.theta);i.scale(this.scaleX*(this.flipX?-1:1),this.scaleY*(this.flipY?-1:1))},toObject:function(){var i={type:this.type,left:c(this.left,this.NUM_FRACTION_DIGITS),top:c(this.top,this.NUM_FRACTION_DIGITS),width:c(this.width,this.NUM_FRACTION_DIGITS),height:c(this.height,this.NUM_FRACTION_DIGITS),fill:this.fill,overlayFill:this.overlayFill,stroke:this.stroke,strokeWidth:this.strokeWidth,scaleX:c(this.scaleX,this.NUM_FRACTION_DIGITS),scaleY:c(this.scaleY,this.NUM_FRACTION_DIGITS),angle:c(this.getAngle(),this.NUM_FRACTION_DIGITS),flipX:this.flipX,flipY:this.flipY,opacity:c(this.opacity,this.NUM_FRACTION_DIGITS),selectable:this.selectable,hasControls:this.hasControls,hasBorders:this.hasBorders,hasRotatingPoint:this.hasRotatingPoint};if(!this.includeDefaultValues){i=this._removeDefaultValues(i)}return i},toDatalessObject:function(){return this.toObject()},getSvgStyles:function(){return["stroke: ",(this.stroke?this.stroke:"none"),"; ","stroke-width: ",(this.strokeWidth?this.strokeWidth:"0"),"; ","fill: ",(this.fill?this.fill:"none"),"; ","opacity: ",(this.opacity?this.opacity:"1"),";"].join("")},getSvgTransform:function(){var i=this.getAngle();return["translate(",c(this.left,2)," ",c(this.top,2),")",i!==0?(" rotate("+c(i,2)+")"):"",(this.scaleX===1&&this.scaleY===1)?"":(" scale("+c(this.scaleX,2)+" "+c(this.scaleY,2)+")")].join("")},_removeDefaultValues:function(q){var i=d.Object.prototype.options;if(i){this.stateProperties.forEach(function(r){if(q[r]===i[r]){delete q[r]}})}return q},isActive:function(){return !!this.active},setActive:function(i){this.active=!!i;return this},toString:function(){return"#"},set:function(q,i){var s=(q==="scaleX"||q==="scaleY")&&ir.x&&s.xr.y&&u.y=v)&&(s.d.y>=v)){continue}if((s.o.x==s.d.x)&&(s.o.x>=w)){x=s.o.x;u=v}else{z=0;y=(s.d.y-s.o.y)/(s.d.x-s.o.x);r=v-z*w;q=s.o.y-y*s.o.x;x=-(r-q)/(z-y);u=r+z*x}if(x>=w){t+=1}if(t==2){break}}return t},_getImageLines:function(r,q){return{topline:{o:r.tl,d:r.tr},rightline:{o:r.tr,d:r.br},bottomline:{o:r.br,d:r.bl},leftline:{o:r.bl,d:r.tl}}},_setCornerCoords:function(){var u=this.oCoords,q=b(45-this.getAngle()),s=Math.sqrt(2*Math.pow(this.cornersize,2))/2,i=s*Math.cos(q),r=s*Math.sin(q),v=Math.sin(this.theta),t=Math.cos(this.theta);u.tl.corner={tl:{x:u.tl.x-r,y:u.tl.y-i},tr:{x:u.tl.x+i,y:u.tl.y-r},bl:{x:u.tl.x-i,y:u.tl.y+r},br:{x:u.tl.x+r,y:u.tl.y+i}};u.tr.corner={tl:{x:u.tr.x-r,y:u.tr.y-i},tr:{x:u.tr.x+i,y:u.tr.y-r},br:{x:u.tr.x+r,y:u.tr.y+i},bl:{x:u.tr.x-i,y:u.tr.y+r}};u.bl.corner={tl:{x:u.bl.x-r,y:u.bl.y-i},bl:{x:u.bl.x-i,y:u.bl.y+r},br:{x:u.bl.x+r,y:u.bl.y+i},tr:{x:u.bl.x+i,y:u.bl.y-r}};u.br.corner={tr:{x:u.br.x+i,y:u.br.y-r},bl:{x:u.br.x-i,y:u.br.y+r},br:{x:u.br.x+r,y:u.br.y+i},tl:{x:u.br.x-r,y:u.br.y-i}};u.ml.corner={tl:{x:u.ml.x-r,y:u.ml.y-i},tr:{x:u.ml.x+i,y:u.ml.y-r},bl:{x:u.ml.x-i,y:u.ml.y+r},br:{x:u.ml.x+r,y:u.ml.y+i}};u.mt.corner={tl:{x:u.mt.x-r,y:u.mt.y-i},tr:{x:u.mt.x+i,y:u.mt.y-r},bl:{x:u.mt.x-i,y:u.mt.y+r},br:{x:u.mt.x+r,y:u.mt.y+i}};u.mr.corner={tl:{x:u.mr.x-r,y:u.mr.y-i},tr:{x:u.mr.x+i,y:u.mr.y-r},bl:{x:u.mr.x-i,y:u.mr.y+r},br:{x:u.mr.x+r,y:u.mr.y+i}};u.mb.corner={tl:{x:u.mb.x-r,y:u.mb.y-i},tr:{x:u.mb.x+i,y:u.mb.y-r},bl:{x:u.mb.x-i,y:u.mb.y+r},br:{x:u.mb.x+r,y:u.mb.y+i}};u.mtr.corner={tl:{x:u.mtr.x-r+(v*this.rotatingPointOffset),y:u.mtr.y-i-(t*this.rotatingPointOffset)},tr:{x:u.mtr.x+i+(v*this.rotatingPointOffset),y:u.mtr.y-r-(t*this.rotatingPointOffset)},bl:{x:u.mtr.x-i+(v*this.rotatingPointOffset),y:u.mtr.y+r-(t*this.rotatingPointOffset)},br:{x:u.mtr.x+r+(v*this.rotatingPointOffset),y:u.mtr.y+i-(t*this.rotatingPointOffset)}}},toGrayscale:function(){var i=this.get("fill");if(i){this.set("overlayFill",new d.Color(i).toGrayscale().toRgb())}return this},complexity:function(){return 0},toJSON:function(){return this.toObject()},setGradientFill:function(i,q){this.set("fill",d.Gradient.forObject(this,i,q))},animate:function(q,s,i){var r=this;i||(i={});if(!("from" in i)){i.from=this.get(q)}if(/[+-]/.test((s+"").charAt(0))){s=this.get(q)+parseFloat(s)}d.util.animate({startValue:i.from,endValue:s,byValue:i.by,easing:i.easing,duration:i.duration,onChange:function(t){r.set(q,t);i.onChange&&i.onChange()},onComplete:function(){r.setCoords();i.onComplete&&i.onComplete()}})}});d.Object.prototype.rotate=d.Object.prototype.setAngle;var j=d.Object.prototype;for(var g=j.stateProperties.length;g--;){var h=j.stateProperties[g],e=h.charAt(0).toUpperCase()+h.slice(1),f="set"+e,n="get"+e;if(!j[n]){j[n]=(function(i){return new Function('return this.get("'+i+'")')})(h)}if(!j[f]){j[f]=(function(i){return new Function("value",'return this.set("'+i+'", value)')})(h)}}l(d.Object.prototype,d.Observable)})(typeof exports!="undefined"?exports:this);(function(b){var c=b.fabric||(b.fabric={}),e=c.util.object.extend,d=c.Object.prototype.set,a={x1:1,x2:1,y1:1,y2:1};if(c.Line){c.warn("fabric.Line is already defined");return}c.Line=c.util.createClass(c.Object,{type:"line",initialize:function(g,f){if(!g){g=[0,0,0,0]}this.callSuper("initialize",f);this.set("x1",g[0]);this.set("y1",g[1]);this.set("x2",g[2]);this.set("y2",g[3]);this._setWidthHeight(f)},_setWidthHeight:function(f){f||(f={});this.set("width",(this.x2-this.x1)||1);this.set("height",(this.y2-this.y1)||1);this.set("left","left" in f?f.left:(this.x1+this.width/2));this.set("top","top" in f?f.top:(this.y1+this.height/2))},set:function(f,g){d.call(this,f,g);if(f in a){this._setWidthHeight()}return this},_render:function(f){f.beginPath();f.moveTo(this.width===1?0:(-this.width/2),this.height===1?0:(-this.height/2));f.lineTo(this.width===1?0:(this.width/2),this.height===1?0:(this.height/2));f.lineWidth=this.strokeWidth;var g=f.strokeStyle;f.strokeStyle=f.fillStyle;f.stroke();f.strokeStyle=g},complexity:function(){return 1},toObject:function(){return e(this.callSuper("toObject"),{x1:this.get("x1"),y1:this.get("y1"),x2:this.get("x2"),y2:this.get("y2")})},toSVG:function(){return[""].join("")}});c.Line.ATTRIBUTE_NAMES="x1 y1 x2 y2 stroke stroke-width transform".split(" ");c.Line.fromElement=function(g,f){var i=c.parseAttributes(g,c.Line.ATTRIBUTE_NAMES);var h=[i.x1||0,i.y1||0,i.x2||0,i.y2||0];return new c.Line(h,e(i,f))};c.Line.fromObject=function(f){var g=[f.x1,f.y1,f.x2,f.y2];return new c.Line(g,f)}})(typeof exports!="undefined"?exports:this);(function(a){var b=a.fabric||(a.fabric={}),d=Math.PI*2,e=b.util.object.extend;if(b.Circle){b.warn("fabric.Circle is already defined.");return}b.Circle=b.util.createClass(b.Object,{type:"circle",initialize:function(f){f=f||{};this.set("radius",f.radius||0);this.callSuper("initialize",f);var g=this.get("radius")*2;this.set("width",g).set("height",g)},toObject:function(){return e(this.callSuper("toObject"),{radius:this.get("radius")})},toSVG:function(){return('')},_render:function(f,g){f.beginPath();f.globalAlpha*=this.opacity;f.arc(g?this.left:0,g?this.top:0,this.radius,0,d,false);f.closePath();if(this.fill){f.fill()}if(this.stroke){f.stroke()}},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(f){this.radius=f;this.set("width",f*2).set("height",f*2)},complexity:function(){return 1}});b.Circle.ATTRIBUTE_NAMES="cx cy r fill fill-opacity opacity stroke stroke-width transform".split(" ");b.Circle.fromElement=function(g,f){f||(f={});var h=b.parseAttributes(g,b.Circle.ATTRIBUTE_NAMES);if(!c(h)){throw Error("value of `r` attribute is required and can not be negative")}if("left" in h){h.left-=(f.width/2)||0}if("top" in h){h.top-=(f.height/2)||0}return new b.Circle(e(h,f))};function c(f){return(("radius" in f)&&(f.radius>0))}b.Circle.fromObject=function(f){return new b.Circle(f)}})(typeof exports!="undefined"?exports:this);(function(a){var b=a.fabric||(a.fabric={});if(b.Triangle){b.warn("fabric.Triangle is already defined");return}b.Triangle=b.util.createClass(b.Object,{type:"triangle",initialize:function(c){c=c||{};this.callSuper("initialize",c);this.set("width",c.width||100).set("height",c.height||100)},_render:function(c){var d=this.width/2,e=this.height/2;c.beginPath();c.moveTo(-d,e);c.lineTo(0,-e);c.lineTo(d,e);c.closePath();if(this.fill){c.fill()}if(this.stroke){c.stroke()}},complexity:function(){return 1},toSVG:function(){var c=this.width/2,d=this.height/2;var e=[-c+" "+d,"0 "+-d,c+" "+d].join(",");return''}});b.Triangle.fromObject=function(c){return new b.Triangle(c)}})(typeof exports!="undefined"?exports:this);(function(a){var b=a.fabric||(a.fabric={}),c=Math.PI*2,d=b.util.object.extend;if(b.Ellipse){b.warn("fabric.Ellipse is already defined.");return}b.Ellipse=b.util.createClass(b.Object,{type:"ellipse",initialize:function(e){e=e||{};this.callSuper("initialize",e);this.set("rx",e.rx||0);this.set("ry",e.ry||0);this.set("width",this.get("rx")*2);this.set("height",this.get("ry")*2)},toObject:function(){return d(this.callSuper("toObject"),{rx:this.get("rx"),ry:this.get("ry")})},toSVG:function(){return[""].join("")},render:function(e,f){if(this.rx===0||this.ry===0){return}return this.callSuper("render",e,f)},_render:function(e,f){e.beginPath();e.save();e.globalAlpha*=this.opacity;e.transform(1,0,0,this.ry/this.rx,0,0);e.arc(f?this.left:0,f?this.top:0,this.rx,0,c,false);if(this.stroke){e.stroke()}if(this.fill){e.fill()}e.restore()},complexity:function(){return 1}});b.Ellipse.ATTRIBUTE_NAMES="cx cy rx ry fill fill-opacity opacity stroke stroke-width transform".split(" ");b.Ellipse.fromElement=function(f,e){e||(e={});var g=b.parseAttributes(f,b.Ellipse.ATTRIBUTE_NAMES);if("left" in g){g.left-=(e.width/2)||0}if("top" in g){g.top-=(e.height/2)||0}return new b.Ellipse(d(g,e))};b.Ellipse.fromObject=function(e){return new b.Ellipse(e)}})(typeof exports!="undefined"?exports:this);(function(b){var c=b.fabric||(b.fabric={});if(c.Rect){console.warn("fabric.Rect is already defined");return}c.Rect=c.util.createClass(c.Object,{type:"rect",options:{rx:0,ry:0},initialize:function(d){this._initStateProperties();this.callSuper("initialize",d);this._initRxRy()},_initStateProperties:function(){this.stateProperties=this.stateProperties.concat(["rx","ry"])},_initRxRy:function(){if(this.rx&&!this.ry){this.ry=this.rx}else{if(this.ry&&!this.rx){this.rx=this.ry}}},_render:function(f){var j=this.rx||0,i=this.ry||0,d=-this.width/2,k=-this.height/2,e=this.width,g=this.height;f.beginPath();f.globalAlpha*=this.opacity;if(this.group){f.translate(this.x||0,this.y||0)}f.moveTo(d+j,k);f.lineTo(d+e-j,k);f.quadraticCurveTo(d+e,k,d+e,k+i,d+e,k+i);f.lineTo(d+e,k+g-i);f.quadraticCurveTo(d+e,k+g,d+e-j,k+g,d+e-j,k+g);f.lineTo(d+j,k+g);f.quadraticCurveTo(d,k+g,d,k+g-i,d,k+g-i);f.lineTo(d,k+i);f.quadraticCurveTo(d,k,d+j,k,d+j,k);f.closePath();if(this.fill){f.fill()}if(this.stroke){f.stroke()}},_normalizeLeftTopProperties:function(d){if(d.left){this.set("left",d.left+this.getWidth()/2)}this.set("x",d.left||0);if(d.top){this.set("top",d.top+this.getHeight()/2)}this.set("y",d.top||0);return this},complexity:function(){return 1},toObject:function(){return c.util.object.extend(this.callSuper("toObject"),{rx:this.get("rx")||0,ry:this.get("ry")||0})},toSVG:function(){return''}});c.Rect.ATTRIBUTE_NAMES="x y width height rx ry fill fill-opacity opacity stroke stroke-width transform".split(" ");function a(d){d.left=d.left||0;d.top=d.top||0;return d}c.Rect.fromElement=function(e,d){if(!e){return null}var g=c.parseAttributes(e,c.Rect.ATTRIBUTE_NAMES);g=a(g);var f=new c.Rect(c.util.object.extend((d?c.util.object.clone(d):{}),g));f._normalizeLeftTopProperties(g);return f};c.Rect.fromObject=function(d){return new c.Rect(d)}})(typeof exports!="undefined"?exports:this);(function(b){var c=b.fabric||(b.fabric={}),a=c.util.toFixed;if(c.Polyline){c.warn("fabric.Polyline is already defined");return}c.Polyline=c.util.createClass(c.Object,{type:"polyline",initialize:function(e,d){d=d||{};this.set("points",e);this.callSuper("initialize",d);this._calcDimensions()},_calcDimensions:function(){return c.Polygon.prototype._calcDimensions.call(this)},toObject:function(){return c.Polygon.prototype.toObject.call(this)},toSVG:function(){var f=[];for(var e=0,d=this.points.length;e"].join("")},_render:function(f){var e;f.beginPath();f.moveTo(this.points[0].x,this.points[0].y);for(var g=0,d=this.points.length;g"].join("")},_render:function(l){var k;l.beginPath();l.moveTo(this.points[0].x,this.points[0].y);for(var m=0,j=this.points.length;m1){E=Math.sqrt(E);O*=E;N*=E}var R=aa/O;var Q=W/O;var D=(-W)/N;var C=(aa)/N;var H=R*M+Q*L;var q=D*M+C*L;var F=R*T+Q*S;var ab=D*T+C*S;var Z=(F-H)*(F-H)+(ab-q)*(ab-q);var U=1/Z-0.25;if(U<0){U=0}var w=Math.sqrt(U);if(P==J){w=-w}var V=0.5*(H+F)-w*(ab-q);var K=0.5*(q+ab)+w*(F-H);var v=Math.atan2(q-K,H-V);var u=Math.atan2(ab-K,F-V);var Y=u-v;if(Y<0&&P==1){Y+=2*Math.PI}else{if(Y>0&&P==0){Y-=2*Math.PI}}var B=Math.ceil(Math.abs(Y/(Math.PI*0.5+0.001)));var I=[];for(var X=0;X"},toObject:function(){var q=g(this.callSuper("toObject"),{path:this.path});if(this.sourcePath){q.sourcePath=this.sourcePath}if(this.transformMatrix){q.transformMatrix=this.transformMatrix}return q},toDatalessObject:function(){var q=this.toObject();if(this.sourcePath){q.path=this.sourcePath}delete q.sourcePath;return q},toSVG:function(){var t=[];for(var r=0,q=this.path.length;r',"',""].join("")},complexity:function(){return this.path.length},_parsePath:function(){var C=[],z,v,y;for(var u=0,t,q,w=this.path.length;uB){for(var r=1,x=q.length;r"];for(var l=0,j=m.length;l");return k.join("")},toString:function(){return"#"},isSameColor:function(){var j=this.getObjects()[0].get("fill");return this.getObjects().every(function(k){return k.get("fill")===j})},complexity:function(){return this.paths.reduce(function(j,k){return j+((k&&k.complexity)?k.complexity():0)},0)},toGrayscale:function(){var j=this.paths.length;while(j--){this.paths[j].toGrayscale()}return this},getObjects:function(){return this.paths}});function c(m){for(var l=0,j=m.length;l"},getObjects:function(){return this.objects},addWithUpdate:function(h){this._restoreObjectsState();this.objects.push(h);this._calcBounds();this._updateObjectsCoords();return this},removeWithUpdate:function(h){this._restoreObjectsState();f(this.objects,h);h.setActive(false);this._calcBounds();this._updateObjectsCoords();return this},add:function(h){this.objects.push(h);return this},remove:function(h){f(this.objects,h);return this},size:function(){return this.getObjects().length},set:function(h,k){if(typeof k=="function"){this.set(h,k(this[h]))}else{if(h==="fill"||h==="opacity"){var j=this.objects.length;this[h]=k;while(j--){this.objects[j].set(h,k)}}else{this[h]=k}}return this},contains:function(h){return this.objects.indexOf(h)>-1},toObject:function(){return g(this.callSuper("toObject"),{objects:b(this.objects,"clone")})},render:function(j,o){j.save();this.transform(j);var n=Math.max(this.scaleX,this.scaleY);for(var l=0,h=this.objects.length,k;k=this.objects[l];l++){var m=k.borderScaleFactor;k.borderScaleFactor=n;k.render(j);k.borderScaleFactor=m}if(!o&&this.active){this.drawBorders(j);this.hideCorners||this.drawCorners(j)}j.restore();this.setCoords()},item:function(h){return this.getObjects()[h]},complexity:function(){return this.getObjects().reduce(function(i,h){i+=(typeof h.complexity=="function")?h.complexity():0;return i},0)},_restoreObjectsState:function(){this.objects.forEach(this._restoreObjectState,this);return this},_restoreObjectState:function(j){var l=this.get("left"),m=this.get("top"),h=this.getAngle()*(Math.PI/180),k=j.get("originalLeft"),n=j.get("originalTop"),i=Math.cos(h)*j.get("top")+Math.sin(h)*j.get("left"),o=-Math.sin(h)*j.get("top")+Math.cos(h)*j.get("left");j.setAngle(j.getAngle()+this.getAngle());j.set("left",l+o*this.get("scaleX"));j.set("top",m+i*this.get("scaleY"));j.set("scaleX",j.get("scaleX")*this.get("scaleX"));j.set("scaleY",j.get("scaleY")*this.get("scaleY"));j.setCoords();j.hideCorners=false;j.setActive(false);j.setCoords();return this},destroy:function(){return this._restoreObjectsState()},saveCoords:function(){this._originalLeft=this.get("left");this._originalTop=this.get("top");return this},hasMoved:function(){return this._originalLeft!==this.get("left")||this._originalTop!==this.get("top")},setObjectsCoords:function(){this.forEachObject(function(h){h.setCoords()});return this},activateAllObjects:function(){this.forEachObject(function(h){h.setActive()});return this},forEachObject:e.StaticCanvas.prototype.forEachObject,_setOpacityIfSame:function(){var j=this.getObjects(),i=j[0]?j[0].get("opacity"):1;var h=j.every(function(k){return k.get("opacity")===i});if(h){this.opacity=i}},_calcBounds:function(){var s=[],q=[],p,n,k,h,m,l,u,r=0,t=this.objects.length;for(;ri.x&&j-hi.y},toGrayscale:function(){var h=this.objects.length;while(h--){this.objects[h].toGrayscale()}}});e.Group.fromObject=function(h,i){e.util.enlivenObjects(h.objects,function(j){delete h.objects;i&&i(new e.Group(j,h))})};e.Group.async=true})(typeof exports!="undefined"?exports:this);(function(a){var b=fabric.util.object.extend;if(!a.fabric){a.fabric={}}if(a.fabric.Image){fabric.warn("fabric.Image is already defined.");return}if(!fabric.Object){fabric.warn("fabric.Object is required for fabric.Image initialization");return}fabric.Image=fabric.util.createClass(fabric.Object,{active:false,bordervisibility:false,cornervisibility:false,type:"image",initialize:function(d,c){c||(c={});this.callSuper("initialize",c);this._initElement(d);this._originalImage=this.getElement();this._initConfig(c);this.filters=[];if(c.filters){this.filters=c.filters;this.applyFilters()}},getElement:function(){return this._element},setElement:function(c){this._element=c;this._initConfig();return this},getOriginalSize:function(){var c=this.getElement();return{width:c.width,height:c.height}},setBorderVisibility:function(c){this._resetWidthHeight();this._adjustWidthHeightToBorders(showBorder);this.setCoords()},setCornersVisibility:function(c){this.cornervisibility=!!c},render:function(c,d){c.save();if(!d){this.transform(c)}this._render(c);if(this.active&&!d){this.drawBorders(c);this.hideCorners||this.drawCorners(c)}c.restore()},toObject:function(){return b(this.callSuper("toObject"),{src:this._originalImage.src||this._originalImage._src,filters:this.filters.concat()})},toSVG:function(){return''},getSrc:function(){return this.getElement().src||this.getElement()._src},toString:function(){return'#'},clone:function(c){this.constructor.fromObject(this.toObject(),c)},applyFilters:function(i){if(this.filters.length===0){this.setElement(this._originalImage);i&&i();return}var c=typeof Buffer!=="undefined"&&typeof window==="undefined",g=this._originalImage,e=fabric.document.createElement("canvas"),f=c?new (require("canvas").Image):fabric.document.createElement("img"),h=this;if(!e.getContext&&typeof G_vmlCanvasManager!="undefined"){G_vmlCanvasManager.initElement(e)}e.width=g.width;e.height=g.height;e.getContext("2d").drawImage(g,0,0);this.filters.forEach(function(j){j&&j.applyTo(e)});f.onload=function(){h._element=f;i&&i();f.onload=e=g=null};f.width=g.width;f.height=g.height;if(c){var d=e.toDataURL("image/png").replace(/data:image\/png;base64,/,"");f.src=new Buffer(d,"base64");h._element=f;i&&i()}else{f.src=e.toDataURL("image/png")}return this},_render:function(c){c.drawImage(this.getElement(),-this.width/2,-this.height/2,this.width,this.height)},_adjustWidthHeightToBorders:function(c){if(c){this.currentBorder=this.borderwidth;this.width+=(2*this.currentBorder);this.height+=(2*this.currentBorder)}else{this.currentBorder=0}},_resetWidthHeight:function(){var c=this.getElement();this.set("width",c.width);this.set("height",c.height)},_initElement:function(c){this.setElement(fabric.util.getById(c));fabric.util.addClass(this.getElement(),fabric.Image.CSS_CANVAS)},_initConfig:function(c){c||(c={});this.setOptions(c);this._setBorder();this._setWidthHeight(c)},_initFilters:function(c){if(c.filters&&c.filters.length){this.filters=c.filters.map(function(d){return d&&fabric.Image.filters[d.type].fromObject(d)})}},_setBorder:function(){if(this.bordervisibility){this.currentBorder=this.borderwidth}else{this.currentBorder=0}},_setWidthHeight:function(c){var d=2*this.currentBorder;this.width="width" in c?c.width:((this.getElement().width||0)+d);this.height="height" in c?c.height:((this.getElement().height||0)+d)},complexity:function(){return 1}});fabric.Image.CSS_CANVAS="canvas-img";fabric.Image.prototype.getSvgSrc=fabric.Image.prototype.getSrc;fabric.Image.fromObject=function(d,f){var c=fabric.document.createElement("img"),e=d.src;if(d.width){c.width=d.width}if(d.height){c.height=d.height}c.onload=function(){fabric.Image.prototype._initFilters.call(d,d);var g=new fabric.Image(c,d);f&&f(g);c=c.onload=null};c.src=e};fabric.Image.fromURL=function(d,f,e){var c=fabric.document.createElement("img");c.onload=function(){if(f){f(new fabric.Image(c,e))}c=c.onload=null};c.src=d};fabric.Image.ATTRIBUTE_NAMES="x y width height fill fill-opacity opacity stroke stroke-width transform xlink:href".split(" ");fabric.Image.fromElement=function(d,f,c){c||(c={});var e=fabric.parseAttributes(d,fabric.Image.ATTRIBUTE_NAMES);fabric.Image.fromURL(e["xlink:href"],f,b(e,c))};fabric.Image.async=true})(typeof exports!="undefined"?exports:this);fabric.util.object.extend(fabric.Object.prototype,{_getAngleValueForStraighten:function(){var a=this.get("angle");if(a>-225&&a<=-135){return -180}else{if(a>-135&&a<=-45){return -90}else{if(a>-45&&a<=45){return 0}else{if(a>45&&a<=135){return 90}else{if(a>135&&a<=225){return 180}else{if(a>225&&a<=315){return 270}else{if(a>315){return 360}}}}}}}return 0},straighten:function(){var a=this._getAngleValueForStraighten();this.setAngle(a);return this},fxStraighten:function(b){b=b||{};var c=function(){},d=b.onComplete||c,a=b.onChange||c,e=this;fabric.util.animate({startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(f){e.setAngle(f);a()},onComplete:function(){e.setCoords();d()},onStart:function(){e.setActive(false)}});return this}});fabric.util.object.extend(fabric.StaticCanvas.prototype,{straightenObject:function(a){a.straighten();this.renderAll();return this},fxStraightenObject:function(a){a.fxStraighten({onChange:this.renderAll.bind(this)});return this}});fabric.Image.filters={};fabric.Image.filters.Grayscale=fabric.util.createClass({type:"Grayscale",applyTo:function(d){var c=d.getContext("2d"),a=c.getImageData(0,0,d.width,d.height),h=a.data,e=a.width,l=a.height,k,b,g,f;for(g=0;gh&&m>h&&o>h&&p(a-m)'},_render:function(f){if(typeof Cufon==="undefined"||this.useNative===true){this._renderViaNative(f)}else{this._renderViaCufon(f)}},_renderViaCufon:function(f){var h=Cufon.textOptions||(Cufon.textOptions={});h.left=this.left;h.top=this.top;h.context=f;h.color=this.fill;var g=this._initDummyElementForCufon();this.transform(f);Cufon.replaceElement(g,{engine:"canvas",separate:"none",fontFamily:this.fontFamily,fontWeight:this.fontWeight,textDecoration:this.textDecoration,textShadow:this.textShadow,textAlign:this.textAlign,fontStyle:this.fontStyle,lineHeight:this.lineHeight,strokeStyle:this.strokeStyle,strokeWidth:this.strokeWidth,backgroundColor:this.backgroundColor});this.width=h.width;this.height=h.height;this._totalLineHeight=h.totalLineHeight;this._fontAscent=h.fontAscent;this._boundaries=h.boundaries;this._shadowOffsets=h.shadowOffsets;this._shadows=h.shadows||[];this.setCoords()},_renderViaNative:function(f){this.transform(f);this._setTextStyles(f);var g=this.text.split(/\r?\n/);this.width=this._getTextWidth(f,g);this.height=this._getTextHeight(f,g);this._renderTextBackground(f,g);if(this.textAlign!=="left"){f.save();f.translate(this.textAlign==="center"?(this.width/2):this.width,0)}this._setTextShadow(f);this._renderTextFill(f,g);this.textShadow&&f.restore();this._renderTextStroke(f,g);if(this.textAlign!=="left"){f.restore()}this._renderTextDecoration(f,g);this._setBoundaries(f,g);this._totalLineHeight=0;this.setCoords()},_setBoundaries:function(h,k){this._boundaries=[];for(var j=0,g=k.length;jk){k=l}}return k},_setTextShadow:function(f){if(this.textShadow){var j=/\s*(-?\d+)(?:px)?\s+(-?\d+)(?:px)?\s+(\d+)(?:px)?\s*/;var g=this.textShadow;var i=j.exec(this.textShadow);var h=g.replace(j,"");f.save();f.shadowColor=h;f.shadowOffsetX=parseInt(i[0],10);f.shadowOffsetY=parseInt(i[1],10);f.shadowBlur=parseInt(i[2],10);this._shadows=[{blur:f.shadowBlur,color:f.shadowColor,offX:f.shadowOffsetX,offY:f.shadowOffsetY}];this._shadowOffsets=[[parseInt(f.shadowOffsetX,10),parseInt(f.shadowOffsetY,10)]]}},_renderTextFill:function(g,j){this._boundaries=[];for(var h=0,f=j.length;h-1){f.call(this,this.fontSize)}if(this.textDecoration.indexOf("line-through")>-1){f.call(this,this.fontSize/2)}if(this.textDecoration.indexOf("overline")>-1){f.call(this,0)}},_getFontDeclaration:function(){return[this.fontStyle,this.fontWeight,this.fontSize+"px",this.fontFamily].join(" ")},_initDummyElementForCufon:function(){var g=c.document.createElement("pre"),f=c.document.createElement("div");f.appendChild(g);if(typeof G_vmlCanvasManager=="undefined"){g.innerHTML=this.text}else{g.innerText=this.text.replace(/\r?\n/gi,"\r")}g.style.fontSize=this.fontSize+"px";g.style.letterSpacing="normal";return g},render:function(f,g){f.save();this._render(f);if(!g&&this.active){this.drawBorders(f);this.hideCorners||this.drawCorners(f)}f.restore()},toObject:function(){return e(this.callSuper("toObject"),{text:this.text,fontSize:this.fontSize,fontWeight:this.fontWeight,fontFamily:this.fontFamily,fontStyle:this.fontStyle,lineHeight:this.lineHeight,textDecoration:this.textDecoration,textShadow:this.textShadow,textAlign:this.textAlign,path:this.path,strokeStyle:this.strokeStyle,strokeWidth:this.strokeWidth,backgroundColor:this.backgroundColor})},toSVG:function(){var i=this.text.split(/\r?\n/),j=this.useNative?this.fontSize*this.lineHeight:(-this._fontAscent-((this._fontAscent/5)*this.lineHeight)),g=-(this.width/2),f=this.useNative?this.fontSize-1:(this.height/2)-(i.length*this.fontSize)-this._totalLineHeight,h=this._getSVGTextAndBg(j,g,i),k=this._getSVGShadows(j,i);f+=(this._fontAscent?((this._fontAscent/5)*this.lineHeight):0);return['',h.textBgRects.join(""),"',k.join(""),h.textSpans.join(""),"",""].join("")},_getSVGShadows:function(h,n){var o=[],k,l,p,g,f=1;if(!this._shadows||!this._boundaries){return o}for(k=0,p=this._shadows.length;k",c.util.string.escapeXml(n[l]),"");f=1}else{f++}}}return o},_getSVGTextAndBg:function(j,h,n){var g=[],k=[],l,m,o,f=1;for(l=0,o=n.length;l",c.util.string.escapeXml(n[l]),"");f=1}else{f++}if(!this.backgroundColor||!this._boundaries){continue}k.push("')}return{textSpans:g,textBgRects:k}},_getFillAttributes:function(f){var g=f?new c.Color(f):"";if(!g||!g.getSource()||g.getAlpha()===1){return'fill="'+f+'"'}return'opacity="'+g.getAlpha()+'" fill="'+g.setAlpha(1).toRgb()+'"'},setColor:function(f){this.set("fill",f);return this},setFontsize:function(f){this.set("fontSize",f);this.setCoords();return this},getText:function(){return this.text},setText:function(f){this.set("text",f);this.setCoords();return this},set:function(f,g){if(typeof f=="object"){for(var h in f){this.set(h,f[h])}}else{this[f]=g;if(f==="fontFamily"&&this.path){this.path=this.path.replace(/(.*?)([^\/]*)(\.font\.js)/,"$1"+g+"$3")}}return this}});c.Text.fromObject=function(f){return new c.Text(f.text,d(f))};c.Text.fromElement=function(f){}})(typeof exports!="undefined"?exports:this);(function(){if(typeof document!="undefined"&&typeof window!="undefined"){return}var DOMParser=new require("xmldom").DOMParser,URL=require("url"),HTTP=require("http"),Canvas=require("canvas"),Image=require("canvas").Image;function request(url,encoding,callback){var oURL=URL.parse(url),client=HTTP.createClient(oURL.port,oURL.hostname),request=client.request("GET",oURL.pathname,{host:oURL.hostname});client.addListener("error",function(err){if(err.errno===process.ECONNREFUSED){fabric.log("ECONNREFUSED: connection refused to "+client.host+":"+client.port)}else{fabric.log(err.message)}});request.end();request.on("response",function(response){var body="";if(encoding){response.setEncoding(encoding)}response.on("end",function(){callback(body)});response.on("data",function(chunk){if(response.statusCode==200){body+=chunk}})})}fabric.util.loadImage=function(url,callback){request(url,"binary",function(body){var img=new Image();img.src=new Buffer(body,"binary");img._src=url;callback(img)})};fabric.loadSVGFromURL=function(url,callback){url=url.replace(/^\n\s*/,"").replace(/\?.*$/,"").trim();request(url,"",function(body){var doc=new DOMParser().parseFromString(body);fabric.parseSVGDocument(doc.documentElement,function(results,options){callback(results,options)})})};fabric.util.getScript=function(url,callback){request(url,"",function(body){eval(body);callback&&callback()})};fabric.Image.fromObject=function(object,callback){fabric.util.loadImage(object.src,function(img){var oImg=new fabric.Image(img);oImg._initConfig(object);oImg._initFilters(object);callback(oImg)})};fabric.createCanvasForNode=function(width,height){var canvasEl=fabric.document.createElement("canvas"),nodeCanvas=new Canvas(width||600,height||600);canvasEl.style={};canvasEl.width=nodeCanvas.width;canvasEl.height=nodeCanvas.height;var canvas=fabric.Canvas||fabric.StaticCanvas;var fabricCanvas=new canvas(canvasEl);fabricCanvas.contextContainer=nodeCanvas.getContext("2d");fabricCanvas.nodeCanvas=nodeCanvas;return fabricCanvas};fabric.StaticCanvas.prototype.createPNGStream=function(){return this.nodeCanvas.createPNGStream()};if(fabric.Canvas){fabric.Canvas.prototype.createPNGStream}var origSetWidth=fabric.StaticCanvas.prototype.setWidth;fabric.StaticCanvas.prototype.setWidth=function(width){origSetWidth.call(this);this.nodeCanvas.width=width;return this};if(fabric.Canvas){fabric.Canvas.prototype.setWidth=fabric.StaticCanvas.prototype.setWidth}var origSetHeight=fabric.StaticCanvas.prototype.setHeight;fabric.StaticCanvas.prototype.setHeight=function(height){origSetHeight.call(this);this.nodeCanvas.height=height;return this};if(fabric.Canvas){fabric.Canvas.prototype.setHeight=fabric.StaticCanvas.prototype.setHeight}})(); \ No newline at end of file diff --git a/dist/all.min.js.gz b/dist/all.min.js.gz index 8cc02c2f9e92ff2f8e686d1f56aea7b003a38e4f..71311d26254a9a8a1f86b40c17d22ede1c543784 100644 GIT binary patch delta 18258 zcmV({K+?b4zXIyN0tO$82nhJ*u?Ad4e<2O)k!3r{OyXp1=g=xz4{w6vApxXBO5*=&ruItE;N(AQZ1dMxE(H(U*E8!b&;JrLYc(=$}11KXOFW&(5PJ z+E4g{YsX#n)5*e#`kZm|^;9@+r>X(RpRooF*^zp>8Azqrfzk5*TY$EiurtH4f6-QY zid0ko2)&u9;1^ZvchnrCmvolnhYgHKGjhNWEbs#l{7^ijS2zp&&;md7z@Le))P6RL zl?XuUW?e?^XOBK}tHHBcutoSt!?jX)i27ejO0g$@NgJW}m!!+O(N1(?O+DEV+leUW zS*O5wuNQA~RfM4-%0u>H+>TNYf4ia`TT$9i=F3U1GMl3%opNPg`8Pjk{=3rWHUsUh z$sV5K9bv{6G; zi%ew1ES5BvJaY0(oeA$GSoEGW- zi-o8YGaGLv9;M-p)_%Snxk0dX9LmrNV3epp;8q=R(!!X9*hj`beuLgj*bAEoE68DC z<0I4fST^p>eeT?rhF(l5pI_&<7Ge;mlncOal(}`&k!orZ3JiZ zEbgHV?dx8-_Ou3$qHC9eed?v{8;=6On_Tu7@u;h4;!$BFBCrBt=?ptknThP`zbCea z>}gXy1R`m(x(^JniZJ0(N<~$TS^7AOi)LF)jXcs|qEJ1rvGtJY zGck=6Ii!7!8RL4VKTKvnwHG6`pBV;PZH?(Skj-PXGn;U%1dseCF1f`34{kuue_gfD zUc~Yg1x^QtlX<5-Az`cExXnK3F&1+GSS4a%=5>ky#g?8k9(ha+I9X{wTL3p6(xT7I zUCuAQvsSe#CC;QeE;pgZTNmd$J5Q#xcVNq9p`RP6O+vRyI2JhoR&eze-09TRslwZ< zVjAi4E*tMdN*XkGuKjs(_BdF_|!+?yG_k-%FoVFWUe_g=`ogY{+ zGwEAb6h8UeL1Go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s3Y1AxOK0RTyvS0lS}d+n4>{rW2ZV z-aj})=!z9~fV4lXR*l;HTyG?e#%v#BdNU1aGvPlI)X}8`5EvKabYde?5@@x)h^ zWVY-ZPrE5P)d;rt(Pw|ft~xZM>Xr$|(XZv<%FmJn(C&(h*N&yh3~Kxr7sE=Wasqz& zVjoBLa#xwe-f0Bce;f+yPHSE$Uc(u9?saPz4~{rOJv+A^M1aBY3ksExE#wjV(KN&dsCkz;}BwX|$ zH`>^xa|UlvfBb7b3)^$57}zIU92|I#0W3EOuiyXp6UsGHGJ4bw3s%!fZ$1s8y3QA9 z%c%30=>*X2cb`7}WYR{91-kKLmN?G&J`n8xro<wNqnh^s5fWlm3xs=$LC8{Grkd=H z&c+s?O{;PY!O5!|V$Ez-WkI7}n+4t-EoUtDHBBzsi)D5)@Ac#Ou+fO_u%2p6kT6#G zpRMYL#<9}Nl&TZ=n%QFZ4h%ZUtevi{_NkA|e;ZHPRG95=qZWMo?jjIa*TE3zmnDX( zTYA)xN>0P{YPEYnt-bZ_huu!X7uI4B+<*T*!xtcYyRjrmNA6~&gIRfj1Pdi+{qq7Z7(ay5zeoV~Q1EHW`?RTFFV{hWuiF#ZbyZ|%M>lV`R&LhL*O%2~;ntF1b#iy49o@h>GyeL1T3}?3*)7a+ zTx)Sfc7}59rE>HD5X2sYM1zE9-_Fx_cs_JzY!6#f1CjvWOdjp$W(E~XY>$KCpP}@4 z@J*v3l;Z;UjoswxSx|{akvfIxOH-W`f70uGNmN<@Qd7lrTXmZA@9ztYN(q|NtzL8S zP_?BtwQNUfIGwQnM7$+UAADV1x1>Ee`lq6lY)HLaB|bWN_J4Z!EgZdmds<-sK-7-a zF|P#LKOpI3PmtcW4>dYFeG22*8dO1x^etq G9|8bMDJqKq diff --git a/src/text.class.js b/src/text.class.js index 8f841b16..3db615b0 100644 --- a/src/text.class.js +++ b/src/text.class.js @@ -121,10 +121,25 @@ this.text = text; this.setOptions(options); this.theta = this.angle * Math.PI / 180; - this.width = this.getWidth(); + this._initDimensions(); this.setCoords(); }, + /** + * Renders text object on offscreen canvas, so that it would get dimensions + * @private + * @method _initDimensions + */ + _initDimensions: function() { + var canvasEl = fabric.document.createElement('canvas'); + + if (!canvasEl.getContext && typeof G_vmlCanvasManager != 'undefined') { + G_vmlCanvasManager.initElement(canvasEl); + } + + this._render(canvasEl.getContext('2d')); + }, + /** * Creates `stateProperties` list on an instance, and adds `fabric.Text` -specific ones to it * (such as "fontFamily", "fontWeight", etc.)