From baa0dd864bf1cf39c13f1162df988d51f47be6ca Mon Sep 17 00:00:00 2001 From: "Luis A. Leiva" Date: Sun, 21 Jun 2015 13:06:47 +0200 Subject: [PATCH] Fixed: mitter -> miter --- jsketch.js | 8 ++++---- jsketch.min.js | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/jsketch.js b/jsketch.js index c31569a..7635d82 100644 --- a/jsketch.js +++ b/jsketch.js @@ -47,7 +47,7 @@ this.graphics.lineWidth = typeof options.lineWidth !== 'undefined' ? options.lineWidth : 2; this.graphics.lineCap = typeof options.lineCap !== 'undefined' ? options.lineCap : 'round'; this.graphics.lineJoin = typeof options.lineJoin !== 'undefined' ? options.lineJoin : 'round'; - this.graphics.mitterLimit = typeof options.mitterLimit !== 'undefined' ? options.mitterLimit : 10; + this.graphics.miterLimit = typeof options.miterLimit !== 'undefined' ? options.miterLimit : 10; // Remember graphic options for later saveing/restoring drawing status. this.graphics.options = Object.keys(options); // Make room for storing some data such as brush type, colors, etc. @@ -141,16 +141,16 @@ * @param {Number} thickness - Line thickness. * @param {String} capStyle - Style of line cap. * @param {String} joinStyle - Style of line join. - * @param {String} mitter - Style of mitter. + * @param {String} miter - Style of line miter. Only works if capStyle is "miter". * @return jSketch * @memberof jSketch */ - lineStyle: function(color,thickness,capStyle,joinStyle,mitter) { + lineStyle: function(color,thickness,capStyle,joinStyle,miter) { this.graphics.strokeStyle = color || this.graphics.strokeStyle; this.graphics.lineWidth = thickness || this.graphics.lineWidth; this.graphics.lineCap = capStyle || this.graphics.lineCap; this.graphics.lineJoin = joinStyle || this.graphics.lineJoin; - this.graphics.mitterLimit = mitter || this.graphics.mitterLimit; + this.graphics.miterLimit = miter || this.graphics.miterLimit; return this; }, /** diff --git a/jsketch.min.js b/jsketch.min.js index 73d7a7f..10c4a13 100644 --- a/jsketch.min.js +++ b/jsketch.min.js @@ -1 +1,5 @@ -!function(i){var t=function(i,t){return new s(i,t)},s=function(i,t){return i?("undefined"==typeof t&&(t={}),this.context(i),this.stageWidth=i.getAttribute("width"),this.stageHeight=i.getAttribute("height"),this.graphics.fillStyle="undefined"!=typeof t.fillStyle?t.fillStyle:"#F00",this.graphics.strokeStyle="undefined"!=typeof t.strokeStyle?t.strokeStyle:"#F0F",this.graphics.lineWidth="undefined"!=typeof t.lineWidth?t.lineWidth:2,this.graphics.lineCap="undefined"!=typeof t.lineCap?t.lineCap:"round",this.graphics.lineJoin="undefined"!=typeof t.lineJoin?t.lineJoin:"round",this.graphics.mitterLimit="undefined"!=typeof t.mitterLimit?t.mitterLimit:10,this.graphics.options=Object.keys(t),this.data={},this):void 0};t.fn=s.prototype={context:function(i){if(null==i)throw"No canvas element specified.";return this.canvas=i,this.graphics=i.getContext("2d"),this},size:function(i,t){return this.stageWidth=i,this.stageHeight=t,this.canvas.width=i,this.canvas.height=t,this},background:function(i){var t=this.graphics.fillStyle;return this.beginFill(i),this.graphics.fillRect(0,0,this.stageWidth,this.stageHeight),this.beginFill(t),this},stage:function(i,t,s){return this.size(i,t).background(s),this},beginFill:function(i){return this.saveGraphics(),this.graphics.fillStyle=i,this},endFill:function(){return this.graphics.fillStyle=this.data.fillStyle,this},lineStyle:function(i,t,s,e,h){return this.graphics.strokeStyle=i||this.graphics.strokeStyle,this.graphics.lineWidth=t||this.graphics.lineWidth,this.graphics.lineCap=s||this.graphics.lineCap,this.graphics.lineJoin=e||this.graphics.lineJoin,this.graphics.mitterLimit=h||this.graphics.mitterLimit,this},moveTo:function(i,t){return this.graphics.moveTo(i,t),this},lineTo:function(i,t){return this.graphics.lineTo(i,t),this},line:function(i,t,s,e){return this.graphics.moveTo(i,t),this.lineTo(s,e),this},curveTo:function(i,t,s,e){return this.graphics.quadraticCurveTo(s,e,i,t),this},curve:function(i,t,s,e,h,r){return this.graphics.moveTo(i,t),this.curveTo(s,e,h,r),this},stroke:function(){return this.graphics.stroke(),this},strokeRect:function(i,t,s,e){return this.graphics.beginPath(),this.graphics.strokeRect(i,t,s,e),this.graphics.closePath(),this},fillRect:function(i,t,s,e){return this.graphics.beginPath(),this.graphics.fillRect(i,t,s,e),this.graphics.closePath(),this},strokeCircle:function(i,t,s){return this.graphics.beginPath(),this.graphics.arc(i,t,s,0,2*Math.PI,!1),this.graphics.stroke(),this.graphics.closePath(),this},fillCircle:function(i,t,s){return this.graphics.beginPath(),this.graphics.arc(i,t,s,0,2*Math.PI,!1),this.graphics.fill(),this.graphics.closePath(),this},radialCircle:function(i,t,s,e,h){var r=this.graphics.createRadialGradient(i,t,s,i,t,h);return r.addColorStop(0,e),r.addColorStop(1,"rgba(0,0,0,0)"),this.graphics.fillStyle=r,this.fillCircle(i,t,s),this},beginPath:function(){return this.saveGraphics(),this.graphics.beginPath(),this},closePath:function(){return this.graphics.closePath(),this.restoreGraphics(),this},eraser:function(i){return"undefined"==typeof i&&(i=15),this.graphics.globalCompositeOperation="destination-out",this.graphics.lineWidth=i,this},pencil:function(i){return"undefined"!=typeof i&&(this.graphics.lineWidth=i),this.graphics.globalCompositeOperation="source-over",this},clear:function(){return this.graphics.clearRect(0,0,this.stageWidth,this.stageHeight),this.data={},this},save:function(){return this.graphics.save(),this},restore:function(){return this.graphics.restore(),this},saveGraphics:function(i){"undefined"==typeof i&&(i=this.graphics.options),"string"==typeof i&&(i=i.split(" "));for(var t=0;t