Skip to content

Commit

Permalink
Prepare v1.3.8 (#271)
Browse files Browse the repository at this point in the history
* Fixed radial gradients - take radius and linewidth into account.
* Updated package version and dist-files
  • Loading branch information
kplindegaard authored Feb 18, 2024
1 parent df4c08a commit ca78d83
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 15 deletions.
12 changes: 7 additions & 5 deletions dist/gauge.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,9 @@ class Gauge extends BaseGauge
fillStyle = @getColorForValue(@displayedValue, @options.generateGradient)
else if @options.colorStop != undefined
if @options.gradientType == 0
fillStyle = this.ctx.createRadialGradient(w, h, 9, w, h, 70)
start = radius - @lineWidth / 2
stop = radius + @lineWidth / 2
fillStyle = this.ctx.createRadialGradient(w, h, start, w, h, stop)
else
fillStyle = this.ctx.createLinearGradient(0, 0, w, 0)
fillStyle.addColorStop(0, @options.colorStart)
Expand Down Expand Up @@ -637,12 +639,12 @@ class BaseDonut extends BaseGauge
if @textField
@textField.render(@)

grdFill = @ctx.createRadialGradient(w, h, 39, w, h, 70)
grdFill.addColorStop(0, @options.colorStart)
grdFill.addColorStop(1, @options.colorStop)

start = @radius - @lineWidth / 2
stop = @radius + @lineWidth / 2

grdFill = @ctx.createRadialGradient(w, h, start, w, h, stop)
grdFill.addColorStop(0, @options.colorStart)
grdFill.addColorStop(1, @options.colorStop)

@ctx.strokeStyle = @options.strokeColor
@ctx.beginPath()
Expand Down
12 changes: 7 additions & 5 deletions dist/gauge.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/gauge.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/gauge.min.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,14 @@ <h2>Supported browsers</h2>

<h2>Changes</h2>

<h3 id="v1.3.8">Version 1.3.8 (18.02.2024)</h3>
<p>
<ul>
<li>Merged <a href='https://github.com/bernii/gauge.js/pull/229'>#229</a> scope polution.</li>
<li>Fixed <a href='https://github.com/bernii/gauge.js/issues/208'>#208</a> so radial gradients take gauge/donut radius and linewidth into account.</li>
<li>Added build script and instructions to the readme.</li>
</ul>
</p>

<h3 id="v1.3.7">Version 1.3.7 (15.06.2019)</h3>
<p>
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gaugeJS",
"version": "1.3.7",
"version": "1.3.8",
"description": "100% native and cool looking animated JavaScript/CoffeeScript gauge",
"main": "dist/gauge.js",
"repository": {
Expand Down

0 comments on commit ca78d83

Please sign in to comment.