From 895a8ac570548339a4add4b1e5354f63ba6c3cb5 Mon Sep 17 00:00:00 2001 From: Rostyslav Bryzgunov Date: Sun, 23 Apr 2017 19:56:31 -0400 Subject: [PATCH] Update easing function declaration. Bump the next version. Easing function had obsolete declaration with 5 arguments, should be only 1. --- bower.json | 2 +- dist/circle-progress.js | 14 +++++++++----- dist/circle-progress.min.js | 4 ++-- docs/index.html | 12 +++++------- package.json | 2 +- 5 files changed, 18 insertions(+), 16 deletions(-) diff --git a/bower.json b/bower.json index 7afad83..d311ced 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "jquery-circle-progress", - "version": "1.2.1", + "version": "1.2.2", "authors": [ "Rostyslav Bryzgunov " ], diff --git a/dist/circle-progress.js b/dist/circle-progress.js index e53279a..7a19213 100644 --- a/dist/circle-progress.js +++ b/dist/circle-progress.js @@ -3,7 +3,7 @@ * {@link http://kottenator.github.io/jquery-circle-progress/} * * @author Rostyslav Bryzgunov - * @version 1.2.1 + * @version 1.2.2 * @licence MIT * @preserve */ @@ -470,10 +470,14 @@ }; // ease-in-out-cubic - $.easing.circleProgressEasing = function(x, t, b, c, d) { - if ((t /= d / 2) < 1) - return c / 2 * t * t * t + b; - return c / 2 * ((t -= 2) * t * t + 2) + b; + $.easing.circleProgressEasing = function(x) { + if (x < 0.5) { + x = 2 * x; + return 0.5 * x * x * x; + } else { + x = 2 - 2 * x; + return 1 - 0.5 * x * x * x; + } }; /** diff --git a/dist/circle-progress.min.js b/dist/circle-progress.min.js index 0508e0e..a4c4053 100644 --- a/dist/circle-progress.min.js +++ b/dist/circle-progress.min.js @@ -3,8 +3,8 @@ * {@link http://kottenator.github.io/jquery-circle-progress/} * * @author Rostyslav Bryzgunov - * @version 1.2.1 + * @version 1.2.2 * @licence MIT * @preserve */ -!function(i){if("function"==typeof define&&define.amd)define(["jquery"],i);else if("object"==typeof module&&module.exports){var t=require("jquery");i(t),module.exports=t}else i(jQuery)}(function(i){function t(i){this.init(i)}t.prototype={value:0,size:100,startAngle:-Math.PI,thickness:"auto",fill:{gradient:["#3aeabb","#fdd250"]},emptyFill:"rgba(0, 0, 0, .1)",animation:{duration:1200,easing:"circleProgressEasing"},animationStartValue:0,reverse:!1,lineCap:"butt",insertMode:"prepend",constructor:t,el:null,canvas:null,ctx:null,radius:0,arcFill:null,lastFrameValue:0,init:function(t){i.extend(this,t),this.radius=this.size/2,this.initWidget(),this.initFill(),this.draw(),this.el.trigger("circle-inited")},initWidget:function(){this.canvas||(this.canvas=i("")["prepend"==this.insertMode?"prependTo":"appendTo"](this.el)[0]);var t=this.canvas;if(t.width=this.size,t.height=this.size,this.ctx=t.getContext("2d"),window.devicePixelRatio>1){var e=window.devicePixelRatio;t.style.width=t.style.height=this.size+"px",t.width=t.height=this.size*e,this.ctx.scale(e,e)}},initFill:function(){function t(){var t=i("")[0];t.width=e.size,t.height=e.size,t.getContext("2d").drawImage(g,0,0,r,r),e.arcFill=e.ctx.createPattern(t,"no-repeat"),e.drawFrame(e.lastFrameValue)}var e=this,a=this.fill,n=this.ctx,r=this.size;if(!a)throw Error("The fill is not specified!");if("string"==typeof a&&(a={color:a}),a.color&&(this.arcFill=a.color),a.gradient){var s=a.gradient;if(1==s.length)this.arcFill=s[0];else if(s.length>1){for(var l=a.gradientAngle||0,o=a.gradientDirection||[r/2*(1-Math.cos(l)),r/2*(1+Math.sin(l)),r/2*(1+Math.cos(l)),r/2*(1-Math.sin(l))],h=n.createLinearGradient.apply(n,o),c=0;c")["prepend"==this.insertMode?"prependTo":"appendTo"](this.el)[0]);var t=this.canvas;if(t.width=this.size,t.height=this.size,this.ctx=t.getContext("2d"),window.devicePixelRatio>1){var e=window.devicePixelRatio;t.style.width=t.style.height=this.size+"px",t.width=t.height=this.size*e,this.ctx.scale(e,e)}},initFill:function(){function t(){var t=i("")[0];t.width=e.size,t.height=e.size,t.getContext("2d").drawImage(g,0,0,r,r),e.arcFill=e.ctx.createPattern(t,"no-repeat"),e.drawFrame(e.lastFrameValue)}var e=this,a=this.fill,n=this.ctx,r=this.size;if(!a)throw Error("The fill is not specified!");if("string"==typeof a&&(a={color:a}),a.color&&(this.arcFill=a.color),a.gradient){var s=a.gradient;if(1==s.length)this.arcFill=s[0];else if(s.length>1){for(var l=a.gradientAngle||0,o=a.gradientDirection||[r/2*(1-Math.cos(l)),r/2*(1+Math.sin(l)),r/2*(1+Math.cos(l)),r/2*(1-Math.sin(l))],h=n.createLinearGradient.apply(n,o),c=0;c read the documentation on GitHub

-

-

- Download version 1.2.1 - bower install jquery-circle-progress - npm install jquery-circle-progress -
+

+ Download version 1.2.2 + bower install jquery-circle-progress + npm install jquery-circle-progress

@@ -74,7 +72,7 @@

- + diff --git a/package.json b/package.json index 730d0a5..2a4abc1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jquery-circle-progress", - "version": "1.2.1", + "version": "1.2.2", "author": "Rostyslav Bryzgunov ", "description": "Plugin to draw animated circular progress bars", "license": "MIT",