diff --git a/CanvasTextWrapper.min.js b/CanvasTextWrapper.min.js deleted file mode 100644 index f016061..0000000 --- a/CanvasTextWrapper.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! CanvasTextWrapper (https://github.com/namniak/CanvasTextWrapper) - * Version: 0.1.0 - * - * MIT License (http://www.opensource.org/licenses/mit-license.html) - * Copyright (c) 2014 Vadim Namniak - */ -!function(){"use strict";var a={font:"18px Arial, sans-serif",textAlign:"left",verticalAlign:"top",paddingX:0,paddingY:0,fitParent:!1,lineBreak:"auto"};window.CanvasTextWrapper=function(b,c,d){if(!(this instanceof CanvasTextWrapper))throw new TypeError('CanvasTextWrapper constructor failed. Use "new" keyword when instantiating.');this.canvas=b,this.text=c;for(var e in a)this[e]=d&&d[e]?d[e]:a[e];this.lineHeight=parseInt(this.font.replace(/^\D+/g,""),10),this.validate(),this.context=this.canvas.getContext("2d"),this.context.font=this.font,this.context.textBaseline="bottom",this.drawText()},CanvasTextWrapper.prototype={drawText:function(){var a=this.canvas,b=a.getContext("2d"),c=this.fitParent===!1?a.width:a.parentNode.clientWidth,d=c-2*this.paddingX,e=this.text.split(/\s+/),f=[],g={x:0,y:0};this.checkWordsLength(b,e,d),this.breakTextIntoLines(b,f,e,d);var h=f.length*this.lineHeight;this.setTextVerticalAlign(g,h);for(var i=0;ic){for(var g=0;a.measureText(e+b[d][g]).width<=c&&g